qfai 2.1.1 → 2.1.2

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 (134) hide show
  1. package/README.md +56 -36
  2. package/assets/defaults/agent-routing/qfai-triage.yml +9 -0
  3. package/assets/defaults/workflows/run-owned-cleanup.yml +12 -0
  4. package/assets/init/.claude/settings.json +27 -9
  5. package/assets/init/.codex/hooks.json +20 -8
  6. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +5 -0
  7. package/assets/init/.qfai/assistant/agent/product-experience-architect.md +4 -0
  8. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +7 -0
  9. package/assets/init/.qfai/assistant/agent/requirements-analyst.md +8 -0
  10. package/assets/init/.qfai/assistant/rule/communication.md +18 -8
  11. package/assets/init/.qfai/assistant/rule/drift-protocol.md +58 -2
  12. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +6 -4
  13. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +48 -0
  14. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +15 -25
  15. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +8 -8
  16. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +6 -1
  17. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +3 -3
  18. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +3 -7
  19. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +2 -4
  20. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +1 -6
  21. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +0 -16
  22. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +9 -3
  23. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +9 -1
  24. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +46 -0
  25. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +3 -0
  26. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +3 -3
  27. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +12 -6
  28. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +1 -265
  29. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +273 -0
  30. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +4 -3
  31. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +2 -3
  32. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +17 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +30 -17
  34. package/assets/init/.qfai/assistant/skill/qfai-run/references/evidence-delivery.md +322 -0
  35. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +47 -24
  36. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +218 -11
  37. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +4 -3
  38. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +14 -0
  39. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +4 -3
  40. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +1 -0
  41. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +23 -5
  42. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +8 -0
  43. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +29 -4
  44. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +132 -4
  45. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +14 -2
  46. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +114 -0
  47. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +4 -29
  48. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +38 -1
  49. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +52 -5
  50. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +3 -0
  51. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +29 -19
  52. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +5 -4
  53. package/assets/init/.qfai/assistant/skill/qfai-verify/references/context-load.md +9 -6
  54. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +72 -7
  55. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +35 -21
  56. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/config.toml +2 -4
  57. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/mcp-config.json +9 -5
  58. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/.mcp.json +1 -2
  59. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/config.toml +3 -3
  60. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/mcp-config.json +11 -8
  61. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/config.toml +1 -1
  62. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/mcp-config.json +7 -3
  63. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +0 -4
  64. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +98 -8
  65. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +3 -2
  66. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +1 -0
  67. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +2 -0
  68. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +1 -3
  69. package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +1 -1
  70. package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +7 -4
  71. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +4 -1
  72. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +2 -0
  73. package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +2 -2
  74. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +3 -3
  75. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +2 -2
  76. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +4 -3
  77. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +6 -3
  78. package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +4 -3
  79. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +6 -5
  80. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +1 -1
  81. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +4 -3
  82. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +39 -5
  83. package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +22 -2
  84. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +18 -14
  85. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +4 -3
  86. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +4 -0
  87. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +1 -3
  88. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +11 -0
  89. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +2 -0
  90. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +10 -0
  91. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +30 -8
  92. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +5 -4
  93. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +33 -23
  94. package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +5 -3
  95. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +2 -0
  96. package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +4 -0
  97. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +13 -4
  98. package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +8 -5
  99. package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +86 -0
  100. package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +2 -0
  101. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +6 -3
  102. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +1 -0
  103. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +37 -9
  104. package/assets/init/.qfai/assistant/step/verify-external/STEP.md +5 -2
  105. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +7 -16
  106. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +1 -0
  107. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +6 -4
  108. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +121 -30
  109. package/assets/init/root/.agents/rules/ai-readable-markdown.md +2 -2
  110. package/assets/init/root/.agents/rules/api-budget.md +187 -8
  111. package/assets/init/root/.agents/rules/documentation-clarity.md +162 -33
  112. package/assets/init/root/.agents/rules/minimal-implementation.md +3 -3
  113. package/assets/init/root/.agents/rules/reminders.json +27 -14
  114. package/assets/init/root/.agents/rules/session-feedback.md +136 -0
  115. package/assets/init/root/.agents/rules/temporary-files.md +33 -0
  116. package/assets/init/root/.agents/rules/user-questions.md +48 -37
  117. package/assets/init/root/.github/workflows/qfai-docs.yml +1 -1
  118. package/assets/init/root/AGENTS.md +23 -22
  119. package/assets/sandbox-templates/default-deny.yaml +9 -3
  120. package/assets/schemas/workflow/extraction.schema.json +85 -5
  121. package/assets/uix-rev/comparison-review.md +1 -1
  122. package/assets/uix-rev/contracts-review.md +1 -2
  123. package/dist/cli/index.cjs +6697 -8810
  124. package/dist/cli/index.cjs.map +1 -1
  125. package/dist/cli/index.mjs +6036 -8152
  126. package/dist/cli/index.mjs.map +1 -1
  127. package/dist/index.cjs +4947 -7746
  128. package/dist/index.cjs.map +1 -1
  129. package/dist/index.d.cts +18 -658
  130. package/dist/index.d.ts +18 -658
  131. package/dist/index.mjs +4866 -7640
  132. package/dist/index.mjs.map +1 -1
  133. package/package.json +4 -6
  134. package/assets/init/root/CLAUDE.md +0 -46
@@ -14,11 +14,13 @@ A `SKILL.md` states the contract and points at the file that carries the detail.
14
14
  - **One topic per file.** Do not replace an oversized `SKILL.md` with an oversized `references/everything.md`; that is the same problem one directory down. Split by topic and keep each file readable on its own — a reader who followed one pointer should not have to scan past three unrelated subjects to reach the one they came for.
15
15
  - **Every pointer resolves.** A line that moves detail out must name the file (and anchor, when the file covers more than one topic) so the reader is never left guessing where the rule went.
16
16
 
17
- A hard line ceiling backs this up: **800 lines per assistant asset file**, for every `.qfai/assistant/**/*.{md,yml,yaml}` file, counted as `content.split(/\r?\n/).length` — blank lines included. `npx qfai doctor` measures it and reports every file over the ceiling as `assets.lineBudget`. The ceiling is a backstop, not the rule: a file approaching it is a signal to move a section out, not
18
- to raise the number.
17
+ A hard line ceiling backs this up: **500 lines per Markdown assistant asset file** and **800 lines per YAML assistant asset file**, for every `.qfai/assistant/**/*.{md,yml,yaml}` file, counted as `content.split(/\r?\n/).length` — blank lines included.
18
+ `npx qfai doctor` measures it and reports every file over its ceiling as `assets.lineBudget`.
19
+ The ceiling is a backstop, not the rule: a file approaching it is a signal to move a section out, not to raise the number.
19
20
 
20
- It was raised from 500 once, and on measurement rather than on the "this file is long" claim the number exists to refuse: three skill bodies had converged on that ceiling, and the changes in flight against one of them added 161 lines to a body already at 498 — eleven of them crossing the ceiling on their own. The detail those bodies carry is required to sit in the body rather than behind
21
- a pointer, so splitting could not absorb it. Converging on the limit was itself the signal — a body at the ceiling stops shedding topics and starts packing them into longer lines, and a line count cannot see that. Raise it again only against evidence of that kind.
21
+ The Markdown ceiling is the limit an agent can follow in one file: it follows fewer instructions as its context grows, and follows those in the middle of a long file worst. A Markdown file has a `references/` home to move detail into. A YAML asset is parsed as data and cannot be split that way (see below), which is why its ceiling is higher.
22
+
23
+ A body at its ceiling stops shedding topics and starts packing them into longer lines, and a line count cannot see that. The width ceiling below is what catches it.
22
24
 
23
25
  **A width ceiling makes the count honest: 400 characters per line.** A count of lines bounds reading cost only while a line is a roughly constant unit of reading, and packing broke that — one line in the shipped tree ran 9,104 characters against a median of 118, and cost the budget one unit. The two are read together, because each permits what the other refuses: width alone allows a thin
24
26
  file of a thousand short lines, and the count alone allows a packed one.
@@ -0,0 +1,48 @@
1
+ # Worker edits and work orders
2
+
3
+ Read when assigning worker write paths or handling a refused edit.
4
+
5
+ ## Edit boundary
6
+
7
+ The work order names the checkout assigned to the task by the host, the worker's
8
+ write paths and the permitted edit method. Creating a Git worktree does not
9
+ grant the host's tools permission to edit it. Even an assigned checkout can
10
+ receive a refusal; verify the actual edit result rather than claiming access.
11
+
12
+ If an edit is refused, stop writes to that target. Report the tool, working
13
+ directory, target path and refusal text, omitting secrets. Return the owned
14
+ paths and a reviewable diff that can be prepared within the worker's permitted
15
+ area. Do not bypass the refusal through a shell, script or another tool.
16
+ This does not forbid shell authoring where the host already permits it.
17
+
18
+ The orchestrator checks the diff against the current files in its own permitted
19
+ checkout before applying it. If that edit is refused too, leave the application
20
+ pending and continue only independent work. Follow the existing worktree or
21
+ shared-index mode in `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`
22
+ when assigning writers and integrating their paths.
23
+
24
+ ## Work order template
25
+
26
+ ```text
27
+ Task title: <short>
28
+ Role: <sub-agent role>
29
+ Review series: <reviewed artifact> + <reviewer role> + <replacement ordinal> # review work orders only
30
+ Goal: <what to decide/produce>
31
+ Checkout: <absolute checkout assigned to this task by the host>
32
+ Write paths: <exact owned paths, or none for a read-only task>
33
+ Edit method: <host-permitted tool; worktree creation does not grant access>
34
+ If an edit is refused: stop that target; return tool, cwd, target, refusal text, owned paths and a reviewable diff
35
+ Inputs (refs):
36
+ - <file/section>
37
+ - .qfai/assistant/rule/drift-protocol.md#core-rule <!-- the protected set, in front of the agent -->
38
+ Constraints:
39
+ - must: enforce Drift Protocol
40
+ - must: follow applicable test-layer or validation policy
41
+ - must_not: patch upstream artifacts directly; every upstream change requires
42
+ STOP + Change Request + owner rerun per .qfai/assistant/rule/drift-protocol.md
43
+ Output format:
44
+ - <headings / bullet schema>
45
+ Time budget: none | <seconds> # advisory: nothing stops at it. See .qfai/assistant/rule/stage-cost.md
46
+ Elapsed line: end every message with `elapsed <seconds>s / <budget>s`, or `elapsed <seconds>s` when the budget is none
47
+ Acceptance bar: <accept when ...> | <rework when ...> # never `PASS`/`REVISE`: that is the reviewer's vocabulary and the completion gate matches on it, so a doer told to report in it emits a verdict on its own work
48
+ ```
@@ -1,12 +1,12 @@
1
1
  # Shared Skill Delegation Baseline
2
2
 
3
- Use this document to keep SKILL bodies compact. Skill files should reference this baseline and only add role-, stage-, or gate-specific rules.
3
+ Skills cite this baseline and add only role, stage or gate overrides.
4
4
 
5
5
  ## Sub-agent Delegation (MANDATORY)
6
6
 
7
- This section binds every skill and every step as written. A skill or step
8
- restates none of it and writes no placeholder stanza for a subsection it does
9
- not change; it states only an override, under the subsection it overrides.
7
+ This section binds every skill and step. A skill or step repeats none of it
8
+ and adds no placeholder for a subsection it does not change. State only an
9
+ override, under the subsection it overrides.
10
10
 
11
11
  Delegation is optional. The session agent, called the orchestrator below, may
12
12
  author any artifact itself. It uses a sub-agent only for work that runs in
@@ -40,8 +40,15 @@ classified by the taxonomy below before any response.
40
40
  - A read-only agent never runs `git checkout` or `git switch` in a worktree it
41
41
  shares; it reads other revisions with `git show <rev>:<path>`. Each agent
42
42
  writes scratch files only under a path of its own.
43
- - Commit the change, or give each reviewer a fixed commit, before a review
44
- starts, and leave the working tree alone until every review returns.
43
+ - Give each reviewer a fixed commit. Leave the checkout alone until reviews
44
+ return. Only read-only fixed-SHA `git show` reviews permit clean switches.
45
+ Writers, local gates and reviews using live files or checkout-dependent
46
+ execution must finish first.
47
+
48
+ ### Worker edit boundary
49
+
50
+ Before assigning write paths or handling a refused edit, read
51
+ `.qfai/assistant/rule/references/worker-edit-boundary.md`.
45
52
 
46
53
  ### Capability Probe (MUST)
47
54
 
@@ -212,25 +219,8 @@ A blocking review that cannot be delegated because the agent budget is spent is
212
219
 
213
220
  ## Work order template
214
221
 
215
- ```text
216
- Task title: <short>
217
- Role: <sub-agent role>
218
- Review series: <reviewed artifact> + <reviewer role> + <replacement ordinal> # review work orders only
219
- Goal: <what to decide/produce>
220
- Inputs (refs):
221
- - <file/section>
222
- - .qfai/assistant/rule/drift-protocol.md#core-rule <!-- the protected set, in front of the agent -->
223
- Constraints:
224
- - must: enforce Drift Protocol
225
- - must: follow applicable test-layer or validation policy
226
- - must_not: patch upstream artifacts directly; every upstream change requires
227
- STOP + Change Request + owner rerun per .qfai/assistant/rule/drift-protocol.md
228
- Output format:
229
- - <headings / bullet schema>
230
- Time budget: none | <seconds> # advisory: nothing stops at it. See .qfai/assistant/rule/stage-cost.md
231
- Elapsed line: end every message with `elapsed <seconds>s / <budget>s`, or `elapsed <seconds>s` when the budget is none
232
- Acceptance bar: <accept when ...> | <rework when ...> # never `PASS`/`REVISE`: that is the reviewer's vocabulary and the completion gate matches on it, so a doer told to report in it emits a verdict on its own work
233
- ```
222
+ When preparing a delegation, use the template in
223
+ `.qfai/assistant/rule/references/worker-edit-boundary.md#work-order-template`.
234
224
 
235
225
  ## Reviewer response template
236
226
 
@@ -196,9 +196,9 @@ the policy check. The mode is `workflow.mode` in `qfai.config.yaml`. An absent k
196
196
  needs the operator's answer.
197
197
  - A QFAI work order binds the stage to its target: one business flow, or one
198
198
  new-story slot. The stage works on that target and no other.
199
- - The stage result names the agent instance that did the work in
200
- `actor: { agentInstance }`. The run records that instance as the work's
201
- author and never counts it as the work's independent reviewer.
199
+ - The session report names the agent instance that authored the work and
200
+ each independent reviewer. The author never counts as the work's
201
+ independent reviewer.
202
202
  - These statements add to the constitution. They except no article.
203
203
 
204
204
  ## Running Steps (Mandatory)
@@ -268,12 +268,12 @@ writes nothing and states why; the stage's review reads that statement.
268
268
 
269
269
  ## Default Autopilot Policy inside a run
270
270
 
271
- Inside a run, each bucket of a skill's Default Autopilot Policy is
272
- satisfied by one kind of authorization the run records:
271
+ Inside a run, record the authorization for each bucket in the session report:
273
272
 
274
- - An `ask-user` item is satisfied only by a `human_decision` that answers it.
275
- - A `hard-required` input is satisfied by `request_scope` or by the run's
276
- binding.
273
+ - An `ask-user` item is satisfied only by the operator's answer to it.
274
+ Name that answer and its source; an agent's choice is not an operator answer.
275
+ - A `hard-required` input is satisfied by the operator's request or by the
276
+ run's binding. Name the request or work order that supplies it.
277
277
  - An `auto-decide` item needs no authorization.
278
278
  - `--auto` satisfies nothing. It answers no `ask-user` item and supplies no
279
279
  `hard-required` input.
@@ -27,6 +27,8 @@ A downstream skill reads the UI definition in this order.
27
27
  - primary tasks
28
28
  - states
29
29
  - actions
30
+ - supplements (the text shown beyond title, group headings and labels, each with
31
+ its reason) and, when written, structure (the groups and headings, in order)
30
32
 
31
33
  3. **Brand SSOT**
32
34
  - root `DESIGN.md` (front-matter + `# Brand Philosophy` body), the only
@@ -36,6 +38,10 @@ A downstream skill reads the UI definition in this order.
36
38
  prototyping loop ran): the final prototype, procurement and implementation
37
39
  notes
38
40
 
41
+ The supplements and structure are required input: implementation adds no text the
42
+ contract does not declare, and surface review compares the rendered text with them.
43
+ A screen that lacks them is returned to `/qfai-sdd`.
44
+
39
45
  The paths that render a user-visible surface are declared by `uiux.surfacePaths`
40
46
  in `qfai.config.yaml`, and nowhere else.
41
47
 
@@ -51,6 +57,5 @@ in `qfai.config.yaml`, and nowhere else.
51
57
  ## Forbidden Fallbacks
52
58
 
53
59
  - Do not infer downstream UI behavior from discussion-pack sidecars.
54
- - Do not use retired design contract files.
55
60
  - Do not use HTML mock sections as downstream source of truth.
56
61
  - Do not treat a competitor reference as a selected design direction.
@@ -293,7 +293,7 @@ Fill policy templates with repo evidence.
293
293
  - Keep existing content when already accurate.
294
294
  - When evidence is missing, write `TBD` and record what is missing.
295
295
  - Do not invent facts.
296
- - Fill `03_contract/tech.md` in its template's shape: a Stack row for the runtime, the platform and each tool detected, each runtime dependency with its reason, and the quality-gate commands under Standard commands, one labelled item each. It holds no rule and no constraint; a constraint goes to `01_policy/constraint.md`.
296
+ - Fill `03_contract/tech.md` in its template's shape: a Stack row for the runtime, the platform and each tool detected, with one row per test layer whose Choice names the tool, the files it was observed in, and why it fits; each runtime dependency with its reason, and the quality-gate commands under Standard commands, one labelled item each. It holds no rule and no constraint; a constraint goes to `01_policy/constraint.md`.
297
297
  - Fill `## Architecture` of `03_contract/tech.md` from the codebase: one row per layer the module layout shows, what it is responsible for, and the layers its imports reach, or `-`. Name layers, never paths. Implementation places new code by this table and reviewers judge a change against it, so write the import directions the code has.
298
298
  - A layer is a group of modules whose imports point one way: an upper layer uses the layers below it, and a lower layer never imports an upper one.
299
299
  - Draw the layers first, as one `mermaid` `flowchart TD` with a node per layer and an `Upper --> Lower` edge per import direction. Then write the table rows from the uppermost layer down, so each Depends on names only rows below it. `npx qfai validate` reports a diagram and a table that disagree.
@@ -304,10 +304,10 @@ Edit:
304
304
 
305
305
  - `validation.traceability.testFileGlobs`
306
306
  - `validation.traceability.testFileExcludeGlobs` (only if needed)
307
- - `routing` or `reviewProfiles` only when the project needs an override; each matching entry replaces the shipped default as a whole
307
+ - `routing` or `reviewProfiles` only when the user asks to change one; each matching entry replaces the shipped default as a whole
308
308
  - `uiux.surfacePaths`: the repository-relative globs of the paths observed to render a user-visible surface, or `[]` when the repository renders none. Keep an existing value unless the user asks to change it. An absent key leaves the UI impact decision unevaluable.
309
309
 
310
- Keep all other config keys unchanged.
310
+ Keep all other config keys unchanged. Add no key the package already defaults, `paths.specsDir` included; a value the project set stays.
311
311
 
312
312
  ## Step 5 - Evidence sampling
313
313
 
@@ -74,12 +74,9 @@ Completion is blocked until all are true:
74
74
  ordinary. This is the one visual decision made here, because no later stage asks the user for
75
75
  it: `/qfai-sdd`'s `common-design-md` step authors tokens from whatever is recorded. A direction taken without the
76
76
  user carries `chosen_by: assumption` and an open entry in `11_OQ-Register.md`.
77
- 6. No forbidden legacy sidecar exists under `uiux/` (see
78
- `templates/uiux/00_index.md#Forbidden Legacy Files`).
79
77
 
80
78
  Evaluation axes are global constants (4-step ordinal: weak / acceptable / strong /
81
- exceptional) and are NOT authored as discussion sidecars, so no scoring, override, strategy,
82
- taste-interview, option-comparison or selected-anchor sidecar is required or permitted.
79
+ exceptional) and are NOT authored as discussion sidecars.
83
80
 
84
81
  ## CLI Packs
85
82
 
@@ -93,9 +90,8 @@ so conditions 1 and 5 above do not apply to it:
93
90
  `validators/designContractReadiness.ts` skips `QFAI-DCON-030`/`-033`/`-034` for it.
94
91
  - No design direction either: nothing downstream reads a theme for a surface that renders
95
92
  no tokens.
96
- - Conditions 2, 3, 4, 6 and 7 apply unchanged: all three canonical `uiux/` sidecars, the
97
- full screen-contract schema, unranked exploration directions, no forbidden legacy
98
- sidecar, and zero open OQs.
93
+ - Conditions 2, 3, 4 and 7 apply unchanged: all three canonical `uiux/` sidecars, the
94
+ full screen-contract schema, unranked exploration directions, and zero open OQs.
99
95
  - `route:` on a `cli` screen contract names the command invocation, not a web path, as the `cli` section of the UI-bearing playbook sets out.
100
96
  - No `prototyping.yaml`: `cli` is not a valid prototyping execution surface.
101
97
  - `primary_surface: cli` with a visual `secondary_surfaces` entry is NOT a cli-only pack —
@@ -74,7 +74,5 @@ shadows:
74
74
 
75
75
  Trend Scan is **not** a sidecar file. Trend Scan lives at
76
76
  `04_Sources.md#Trend Scan` (part of the core nine-file discussion pack).
77
- The legacy `uiux/20_trend_scan.md` template and the whole `uiux/20-24`
78
- design-evaluation family were removed; evaluation axes are now global
79
- constants and are not authored as discussion sidecars. UI-bearing
80
- completion checks read Trend Scan from `04_Sources.md`.
77
+ Evaluation axes are global constants and are not authored as discussion
78
+ sidecars. UI-bearing completion checks read Trend Scan from `04_Sources.md`.
@@ -116,12 +116,7 @@ Those three are the entire canonical sidecar family. Evaluation axes are global
116
116
  QFAI CLI applies — not by any file in this tree. The reviewer prompt that
117
117
  `/qfai-prototyping` ships restates that axis set; editing it does not change the set the CLI accepts. Axes are not
118
118
  authored as discussion sidecars. Discussion is planner-first: it carries exploration directions
119
- unranked and does not select a single visual winner, so there is no strategy, taste-interview, scoring,
120
- override, option-comparison or selected-anchor sidecar. Do NOT create
121
- `10_implementation_strategy.md`, `11_design_taste_interview.md`, the `20-24`
122
- design-evaluation family, `30_option_comparison.md`, or `31_selected_anchor_screen.md` —
123
- those filenames are forbidden, see `templates/uiux/00_index.md#Forbidden Legacy Files`, and
124
- creating them fails validation.
119
+ unranked and does not select a single visual winner.
125
120
 
126
121
  ### What must be explicit in the discussion pack
127
122
 
@@ -30,19 +30,3 @@ cli-only pack — `primary_surface: cli` with no visual surface in
30
30
  `secondary_surfaces` — never gets one: the `common-design-md` step writes none, and
31
31
  `/qfai-prototyping` does not run on `cli`. Do not report any pack as
32
32
  incomplete for a missing `DESIGN.md`.
33
-
34
- ## Forbidden Legacy Files
35
-
36
- The following files are NOT part of the canonical family and must NOT be created in new packs:
37
-
38
- - `10_implementation_strategy.md` — discussion carries directions unranked, so it selects no strategy
39
- - `11_design_taste_interview.md` — brand signals are recorded in `04_Sources.md`
40
- - `12_design_system.md` — replaced by root `DESIGN.md`
41
- - the `20`–`24` design-evaluation family — the evaluator axes are fixed by the CLI, not authored here
42
- - `30_option_comparison.md` — replaced by root `DESIGN.md`
43
- - `31_selected_anchor_screen.md` — replaced by root `DESIGN.md`
44
- - `33_exploration_rubric.md` — replaced by the fixed evaluator axes (`.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md`)
45
- - `34_evaluator_calibration.md` — replaced by the fixed evaluator axes (`.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md`)
46
- - `40_contracts.md` — replaced by `40_screen_contracts.md`
47
- - `50_review_bundle.md` — replaced by `50_review_input_bundle.md`
48
- - `60_critique_loop.md` — removed (critique integrated into review bundle)
@@ -86,6 +86,11 @@ design. They are written by the `write-acceptance-tests` route, or by
86
86
  `implement-acceptance` run alone, and the report says which BF and AC tests
87
87
  still have an empty body.
88
88
 
89
+ For that report or a handoff of unfinished BF/AC bodies, read
90
+ `.qfai/assistant/step/verify-repo-gate/STEP.md#acceptance-evidence-and-follow-up`.
91
+ It separates annotation proof, body states, actual behavior and execution,
92
+ and the remaining work's owner and completion criteria.
93
+
89
94
  Each of these runs alone, instead of that order, when the request is not new
90
95
  behaviour but a failure, a repair or upkeep:
91
96
 
@@ -139,9 +144,10 @@ every finding of its one review is fixed or answered. Invoked by name, it runs
139
144
  completion; when that fresh validate result has no test-obligation EX finding
140
145
  for this BF, the invocation reports "nothing to do", and reads or writes no
141
146
  ledger status. Inside a route it runs no validate: the verify stage does.
142
- The report ends with a question listing the next actions, `/qfai-verify`
143
- recommended, as `.agents/rules/user-questions.md` § 6 sets out.
144
- Under a no-question mode, list them in the report instead.
147
+ When the next step needs the user's answer, ask a question listing the next
148
+ actions, `/qfai-verify` recommended, per `.agents/rules/user-questions.md` § 6.
149
+ Completion-only reports ask nothing. Under a no-question mode, list remaining
150
+ actions instead.
145
151
 
146
152
  ## Default Autopilot Policy
147
153
 
@@ -10,7 +10,15 @@ For each candidate item, name its production files, test files, contracts, fixtu
10
10
 
11
11
  Deny parallel dispatch when two items write the same shared fixture or mock file, or mutate the same fixture instance. A shared fixture module that both items only read as-is does not by itself deny parallel dispatch.
12
12
 
13
- Give each worker a separate worktree and an exact file ownership list. Workers do not change another worker's files or the story tree. The orchestrator integrates their results and resolves every overlap before judging either item complete.
13
+ Give each worker an exact file ownership list and a checkout assigned by the host.
14
+ Use separate worktrees when the host supports editing them; otherwise use the
15
+ existing shared-index mode in
16
+ `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`.
17
+ Creating a worktree does not grant edit permission. For a refused edit, follow
18
+ `.qfai/assistant/rule/shared-skill-delegation-baseline.md#worker-edit-boundary`.
19
+ Workers do not change another worker's files or the story tree. The orchestrator
20
+ integrates their results and resolves every overlap before judging either item
21
+ complete.
14
22
 
15
23
  ## Integration gate
16
24
 
@@ -6,6 +6,52 @@ A RED observation belongs to one example and one test selector. The test must lo
6
6
 
7
7
  A collection error, import error, syntax error, missing fixture, timeout before the assertion, or unconditional throw is a missing seam. Repair the seam and repeat RED before production behavior is added.
8
8
 
9
+ ### Selected-case execution
10
+
11
+ For each focused Red, Green and Refactor invocation, keep this human receipt
12
+ under the target example in the existing stage report:
13
+
14
+ - The exact command with argument boundaries, cwd, file selection and case
15
+ selector. Preserve the Standard Test command's quoted arguments; a name
16
+ pattern does not select files.
17
+ - The actual runtime version, reporter, input revision and raw output/log
18
+ reference. Explain intentional input changes between invocations.
19
+ - The target EX, test source declaration and full file/parent/case identity.
20
+ Resolve duplicate short names through their full hierarchy; account for the
21
+ runner's actual parent selection rather than assuming a leaf-only pattern
22
+ runs every nesting shape.
23
+ - Evidence that this selected case's body executed, linked to its actual
24
+ terminal result. Retain skip, TODO, cancellation, interruption and any
25
+ expected-failure inversion explicitly.
26
+ - Process exit, aggregate counts and file/container results, apart from that
27
+ case evidence. An annotation and static scanner linkage prove a declaration,
28
+ not runtime execution or a behavioral result.
29
+
30
+ Compare actual TAP start and terminal records, spec named results or JUnit
31
+ nodes with the declared target and its full hierarchy. A TAP label, spec glyph
32
+ or JUnit testcase can belong to a container; none alone proves the selected
33
+ leaf body ran. Dots, coverage and summaries alone are also insufficient. If
34
+ output is unfamiliar, incomplete or cannot identify the selected case, retain
35
+ it, name the missing observation and obtain supported case-level evidence.
36
+ Do not guess a parser or invent a receipt format.
37
+
38
+ Zero selected executions, skip, TODO, cancellation, interruption or missing
39
+ identifiable body evidence cannot close a phase, even with exit zero or a
40
+ passing file/container. Correct selection or observation and repeat the
41
+ focused invocation. Failure of a parent, another case, an import or an
42
+ unconditional throw is not the selected assertion's ordinary RED. An
43
+ expected-failure inversion is recorded separately; its reported pass is not
44
+ ordinary behavior success. Existing approved alternative RED routes remain
45
+ available.
46
+
47
+ Ordinary RED reaches and fails the selected intended assertion or expected
48
+ exception on its stated behavior. GREEN and Refactor must observe that same
49
+ selected behavior succeeding on the intended input. Do not reuse another
50
+ case's result or a prior input revision's result as proof for this invocation.
51
+ The normal verify run establishes full collection coverage; no extra full suite is
52
+ required for each focused cycle. This receipt adds no ledger, JSON field,
53
+ gate status, runtime parser or runner.
54
+
9
55
  ## Assertion control
10
56
 
11
57
  Temporarily neutralize only the example assertion while keeping the test compilable and runnable. The same command must pass. Capture the changed lines and result, then restore the assertion before recording RED. This control shows that the reported failure came from the assertion.
@@ -5,6 +5,7 @@
5
5
  Read the UI surface paths `uiux.surfacePaths` declares in qfai.config.yaml, and resolve paths.contractsDir from the same file. Read every UI contract under its ui/ directory, and the root DESIGN.md if present for the brand tokens.
6
6
  When a prototyping loop ran in this checkout, read its handoff at .qfai/prototype/final/handoff.json: the final prototype, its procurement and the implementation notes.
7
7
  Read the flow, story, acceptance criterion, and example that the implementation changes.
8
+ For each screen the change renders, read its `supplements` and `structure` in the UI contract before adding text: the screen shows its title, group headings, labels and declared supplements, and no other text.
8
9
 
9
10
  ## Routing
10
11
 
@@ -22,3 +23,5 @@ product-surface-reviewer. Do not infer that a change has no UI effect from its d
22
23
  For a UI affecting example, report the screen state, action, expected and observed result, and a capture or rendered artifact. The artifact must identify the source revision. In the stage review, product-surface-reviewer judges each UI affecting example, its UI contracts, and its captured state. The review verdict refers to that revision.
23
24
 
24
25
  If the implementation or capture changes after the verdict, refresh the capture and review. A passing code test cannot substitute for the visual and interaction evidence that the acceptance criterion requires.
26
+
27
+ Capture each declared task at a desktop width and a narrow width, in the normal state and in every declared empty, error, loading and success state the screen has. A text the contract declares that the capture lacks, or a text the capture shows that the contract does not declare, is a finding.
@@ -57,9 +57,9 @@ Markdown and link checks run over the changed files, each exiting 0. A check the
57
57
  project does not have is UNRUN, not a pass.
58
58
 
59
59
  The stage returns what `maintain-edit` lists under "What the stage returns".
60
- The report ends with a question listing the next actions, as
61
- `.agents/rules/user-questions.md` § 6 sets out.
62
- Under a no-question mode, list them in the report instead.
60
+ Ask for the next action only when proceeding requires the user's answer, as
61
+ `.agents/rules/user-questions.md` § 6 sets out. A completion-only report needs
62
+ no question. Under a no-question mode, list any remaining actions instead.
63
63
 
64
64
  ## Default Autopilot Policy
65
65
 
@@ -24,10 +24,16 @@ Follow `.qfai/assistant/rule/shared-skill-operating-baseline.md#user-questions-a
24
24
  for every user question. With `--auto`, ask nothing and record
25
25
  explicit assumptions in the migration report.
26
26
 
27
- Read `references/migration-guide.md` before changing the project. Run this
28
- skill from the project root, where `qfai.config.yaml` and a locally installed
29
- `qfai` package are available. The twelve scripts use the installed package.
30
- They do not add a `qfai` subcommand or make network calls.
27
+ Read `references/migration-guide.md` before changing the project.
28
+
29
+ Read `references/migration-placement.md` when you write `plan.yaml`, when a
30
+ step reports a retired configuration key, and when a step lists a document that
31
+ does not fit its template's shape. It holds the plan format, the retired keys,
32
+ the contract numbers, the business rules and what each document keeps.
33
+
34
+ Run this skill from the project root, where `qfai.config.yaml` and a locally
35
+ installed `qfai` package are available. The twelve scripts use the installed
36
+ package. They do not add a `qfai` subcommand or make network calls.
31
37
 
32
38
  The skill serves two runs, and the steps tell them apart from the project
33
39
  itself:
@@ -81,7 +87,7 @@ keep authors separate from reviewers.
81
87
  each old business rule's destination contract. Name that contract by its
82
88
  current path under `cli/`, `api/`, `db/`, `ui/` or `design/` of the
83
89
  contracts directory: step 3 gives every contract a new ID and file name,
84
- and later steps find it from that path. Use the format in the guide. The plan
90
+ and later steps find it from that path. Use the format in `references/migration-placement.md`. The plan
85
91
  may be written before step 1, from the old contract paths.
86
92
  2. Before the first real run, tell the person that the migration deletes
87
93
  every 1.x file that has no destination and replaces every customised
@@ -112,7 +118,7 @@ keep authors separate from reviewers.
112
118
  5. Resolve every reported item with the person responsible for the content.
113
119
  Preserve any item the scripts could not place. Before step 4 writes
114
120
  `id-map.json`, settle an example that cites several criteria and a rule that
115
- binds no contract through the plan keys the guide names. After it, do not
121
+ binds no contract through the plan keys `references/migration-placement.md` names. After it, do not
116
122
  change `plan.yaml` to move a mapped item. Place remaining content in the new
117
123
  tree through `/qfai-sdd`, and finish each listed item as the guide's
118
124
  "Resolve the reports" section says.