qfai 2.1.0 → 2.1.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 (124) hide show
  1. package/README.md +272 -20
  2. package/assets/defaults/workflows/change-tooling.yml +0 -4
  3. package/assets/init/.claude/settings.json +8 -8
  4. package/assets/init/.codex/hooks.json +6 -6
  5. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +14 -1
  6. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +29 -0
  7. package/assets/init/.qfai/assistant/rule/constitution.md +5 -4
  8. package/assets/init/.qfai/assistant/rule/drift-protocol.md +14 -3
  9. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +70 -0
  10. package/assets/init/.qfai/assistant/rule/references/context-summary.md +30 -0
  11. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +42 -0
  12. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +23 -0
  13. package/assets/init/.qfai/assistant/rule/references/host-backstops.md +60 -0
  14. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +25 -0
  15. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +41 -0
  16. package/assets/init/.qfai/assistant/rule/references/reviewer-remit.md +35 -0
  17. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +26 -139
  18. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +6 -137
  19. package/assets/init/.qfai/assistant/rule/stage-cost.md +1 -1
  20. package/assets/init/.qfai/assistant/rule/test-layers.md +42 -0
  21. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +8 -42
  22. package/assets/init/.qfai/assistant/skill/qfai-configure/references/principles.md +25 -0
  23. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +1 -1
  24. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +9 -2
  25. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/platform_baselines.md +11 -0
  26. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/review_audit_playbook.md +11 -0
  27. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +12 -36
  28. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -1
  29. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +16 -88
  30. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +58 -0
  31. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +42 -0
  32. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +8 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-implement/references/credential-reuse.md +9 -0
  34. package/assets/init/.qfai/assistant/skill/qfai-implement/references/cross-spec-ownership.md +41 -0
  35. package/assets/init/.qfai/assistant/skill/qfai-implement/references/oracle-strength.md +6 -1
  36. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +1 -1
  37. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +1 -3
  38. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +1 -1
  39. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +4 -4
  40. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +19 -5
  41. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +1 -1
  42. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/design-md-spec.md +14 -5
  43. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +10 -0
  44. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +1 -1
  45. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +3 -4
  46. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +10 -2
  47. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +16 -3
  48. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +6 -21
  49. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +30 -10
  50. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +34 -0
  51. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +28 -5
  52. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +29 -0
  53. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +1 -1
  54. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +10 -1
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +21 -9
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +19 -2
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +11 -5
  58. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md +17 -2
  59. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +2 -2
  60. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +5 -5
  61. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +4 -4
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +47 -5
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +15 -3
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +16 -1
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +1 -2
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +2 -2
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/db-contract.sample.sql +2 -2
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/cli/cli-NNNN-title.md +2 -2
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -1
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +4 -0
  72. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +1 -1
  73. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +1 -1
  74. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +22 -8
  75. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +2 -10
  76. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +17 -3
  77. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +30 -7
  78. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +11 -1
  79. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +7 -0
  80. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +3 -3
  81. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +3 -1
  82. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +3 -1
  83. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +2 -0
  84. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +2 -0
  85. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +4 -0
  86. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +7 -3
  87. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +8 -5
  88. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +6 -1
  89. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +20 -3
  90. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +1 -1
  91. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +23 -6
  92. package/assets/init/.qfai/waivers.yml +1 -1
  93. package/assets/init/root/.agents/rules/ai-readable-markdown.md +98 -0
  94. package/assets/init/root/.agents/rules/api-budget.md +4 -5
  95. package/assets/init/root/.agents/rules/documentation-clarity.md +30 -2
  96. package/assets/init/root/.agents/rules/grilling.md +4 -4
  97. package/assets/init/root/.agents/rules/interface-clarity.md +5 -5
  98. package/assets/init/root/.agents/rules/minimal-implementation.md +8 -0
  99. package/assets/init/root/.agents/rules/reminders.json +2 -2
  100. package/assets/init/root/.agents/rules/temporary-files.md +14 -5
  101. package/assets/init/root/.agents/rules/untrusted-content.md +3 -3
  102. package/assets/init/root/.agents/rules/user-questions.md +34 -7
  103. package/assets/init/root/.gitattributes +9 -0
  104. package/assets/init/root/.github/workflows/qfai-docs.yml +43 -11
  105. package/assets/init/root/.github/workflows/qfai-tests.yml +58 -15
  106. package/assets/init/root/.github/workflows/qfai-validate.yml +49 -42
  107. package/assets/init/root/AGENTS.md +1 -0
  108. package/assets/init/root/CLAUDE.md +1 -0
  109. package/assets/mdschema/story/03_contract/tech.mdschema.yml +7 -3
  110. package/assets/sandbox-templates/default-deny.yaml +0 -2
  111. package/assets/schemas/workflow/plan.schema.json +9 -2
  112. package/assets/scripts/check-mdschema.mjs +172 -5
  113. package/dist/cli/index.cjs +3979 -3055
  114. package/dist/cli/index.cjs.map +1 -1
  115. package/dist/cli/index.mjs +3167 -2243
  116. package/dist/cli/index.mjs.map +1 -1
  117. package/dist/index.cjs +3024 -2500
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.d.cts +23 -9
  120. package/dist/index.d.ts +23 -9
  121. package/dist/index.mjs +2881 -2358
  122. package/dist/index.mjs.map +1 -1
  123. package/docs/MIGRATION-2.0.0.md +1 -1
  124. package/package.json +3 -3
@@ -72,7 +72,7 @@ them consistently with each other
72
72
 
73
73
  `/qfai-implement` and the reviewers read it as a CLI-HANDOFF record in the
74
74
  same checkout. `npx qfai validate --profile saas-package` requires it to be present
75
- and to conform, and reports `D-SAAS-PACKAGE-HANDOFF-SCHEMA` naming the file
75
+ and to conform, and reports `QFAI-SAAS-002` naming the file
76
76
  otherwise; no other command reads it.
77
77
 
78
78
  ## Checking an implementation's tokens
@@ -18,9 +18,8 @@
18
18
  ```
19
19
 
20
20
  The orchestrator writes the reviewer's payload for each `(UI contract, screen)` pair beside the
21
- per-iteration `review.json` summary, from the first iteration on (schema:
22
- `references/review-payload-schema.md`, aggregation rule:
23
- `references/reviewer-prompt.md`). That holds for a single-contract run as much
21
+ per-iteration `review.json` summary, from the first iteration on (the payload schema and the aggregation rule are
22
+ in the reviewer references the loop step names). That holds for a single-contract run as much
24
23
  as for a multi-contract one.
25
24
 
26
25
  The reviewer operates Playwright live. A screenshot or HTML snapshot is an
@@ -55,7 +54,7 @@ prototype. It is neutral with respect to AI behavior.
55
54
  ## Produced after the loop
56
55
 
57
56
  - `.qfai/prototype/final/index.html` and `.qfai/prototype/final/handoff.json`.
58
- See `handoff.md`.
57
+ The `prototyping-handoff` step defines its fields.
59
58
 
60
59
  ## Brand identity
61
60
 
@@ -10,6 +10,14 @@ 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, legacy flat key) fails the
11
11
  whole file.
12
12
 
13
+ ## Contents
14
+
15
+ - Path
16
+ - Shape (11 required top-level fields)
17
+ - Field rules
18
+ - Not accepted
19
+ - `sessionStatus` and the retry policy
20
+
13
21
  ## Path
14
22
 
15
23
  ```text
@@ -23,8 +31,8 @@ per-(UI contract × screen) artifact written for a review — no `.html`, no
23
31
  `.png`, no `.interaction.json`.
24
32
 
25
33
  The Reviewer's other result is the per-iteration summary
26
- `iter-NN/review.json` (one per iteration, a different shape — see
27
- `references/reviewer-prompt.md`). It is not a per-screen artifact and
34
+ `iter-NN/review.json` (one per iteration, a different shape, set by
35
+ the reviewer prompt). It is not a per-screen artifact and
28
36
  is never read against this schema.
29
37
 
30
38
  ## Shape (11 required top-level fields)
@@ -18,12 +18,25 @@ put to the user. Explain observable defects and corrective actions in prose. A f
18
18
  score never hides a blocking finding. Do not use numeric AC-pass or
19
19
  transition-pass percentages as a substitute for the qualitative review.
20
20
 
21
+ ## Contents
22
+
23
+ - Inputs
24
+ - Outputs — two files, two schemas
25
+ - Per-iteration summary (`iter-NN/review.json`)
26
+ - The four ordinal UX axes
27
+ - Diagnostic criteria
28
+ - Applying the four axes
29
+ - What blocks
30
+ - Layout anti-pattern matching (`lap-*`)
31
+ - pivotDirective rules
32
+ - Prose critique format (at most 500 English words, or 2500 Japanese/Chinese characters)
33
+
21
34
  ## Inputs
22
35
 
23
36
  - The live prototype URL and declared `screens[]` routes from the UI contract.
24
37
  Open each route in your own Playwright session and exercise its declared
25
38
  primary tasks. Record `sessionStatus` and `retryCount` in the per-screen
26
- payload according to `references/review-payload-schema.md`.
39
+ payload according to the closed per-screen payload schema.
27
40
  - A screenshot or HTML snapshot, only when one was taken. Name any mandatory
28
41
  input you did not receive in a finding.
29
42
  - The layout anti-pattern registry the package ships.
@@ -55,7 +68,7 @@ below and are relative to the project root.
55
68
  per-UI-contract subdirectory is mandatory for every run that declares UI
56
69
  screens, including a run with one contract. Its schema is closed
57
70
  (11 required top-level fields, unknown keys rejected) and lives in
58
- `references/review-payload-schema.md`. Build it from that
71
+ the payload schema reference. Build it from that
59
72
  reference, not from the block below.
60
73
  2. **Per-iteration summary** —
61
74
  `.qfai/prototype/iter-NN/review.json`, one per iteration. Its shape is
@@ -114,7 +127,7 @@ type Review = {
114
127
 
115
128
  Fill `designMdViolations` yourself: one entry per distinct value the
116
129
  prototype uses that root `DESIGN.md` does not declare, in the categories
117
- `generator-prompt.md` lists.
130
+ the generator prompt lists.
118
131
 
119
132
  ## The four ordinal UX axes
120
133
 
@@ -12,7 +12,7 @@ mode: execution-focused
12
12
 
13
13
  ## /qfai-run - Change request entry
14
14
 
15
- [DRIFT-PROTOCOL:MANDATORY]
15
+ [DRIFT-PROTOCOL:REQUIRED]
16
16
 
17
17
  The user states a change once. This skill reads the request into facts, asks
18
18
  `npx qfai workflow plan` for the plan they give, and runs its steps in order.
@@ -20,6 +20,7 @@ The user states a change once. This skill reads the request into facts, asks
20
20
  - The facts a request is read into: `references/extraction.md`.
21
21
  - The command, its input and its output: `references/plan.md`.
22
22
  - What the user sees, and how questions are put: `references/operator-screens.md`.
23
+ - What is done at a release, decision or branch point: `references/stage-points.md`.
23
24
  - Invoke the CLI through the launcher of `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher-mandatory`.
24
25
 
25
26
  ## What this skill never does
@@ -66,26 +67,10 @@ value but the three below plans nothing.
66
67
  5. **Run the stages.** Run each stage in plan order, and each of its steps in
67
68
  order. Write any artifact yourself. Give a part to a sub-agent only to run
68
69
  independent parts in parallel, or for a review. At each step, handle the
69
- points the plan names for it:
70
- - **Release point.** Before a step `releasePoint` names runs, ask the user
71
- to approve the release; where it is `end`, ask once the last stage's
72
- gates have passed, then rerun them over the approval's `decisions.md`
73
- row. `verify-commit` runs after that, so the commit holds the approval. Nothing after it
74
- runs without the approval, which authorizes no push, merge, tag or publication.
75
- - **Decision point.** At a step `decisionPoints` names, put each critical
76
- decision to the user through the structured question tool before
77
- changing anything that depends on it. A decision is critical when it contradicts a
78
- specification, a contract or a recorded decision, cannot be taken back, or
79
- rests on product intent nothing written states. Take every other decision
80
- yourself, ask nothing, and list it with its reason in the final report.
81
- - **Branch point.** When a step `branchPoints` names reports an outcome
82
- paired with one route, move there; with several, to the one the step
83
- names; with `decision-table`, to the route `plan --in` gives the step's
84
- new extraction. Take the destination's plan with
85
- `npx qfai workflow plan --route <route>` at once: no later step of this
86
- route runs. Any other outcome continues the route. Before the third move
87
- and every one after it, ask the user, naming the destination in plain
88
- words; `stop` ends the work. From a scope that leaves stages out, ask before any move.
70
+ points the plan names for it, as `references/stage-points.md` sets out:
71
+ - **Release point.** Ask the user to approve the release before the step `releasePoint` names.
72
+ - **Decision point.** Put each critical decision at a step `decisionPoints` names to the user.
73
+ - **Branch point.** Move to the destination a step `branchPoints` names, and plan it at once.
89
74
  6. **Review.** After a stage whose `review` is `spec`, `requirements-reviewer`
90
75
  reviews, with `architecture-reviewer` when a contract changed; after one
91
76
  whose `review` is `code`, `implementation-reviewer`.
@@ -8,6 +8,19 @@ route, stage or step.
8
8
  Every vocabulary here is closed. `plan` refuses a value this file does not
9
9
  define.
10
10
 
11
+ ## Contents
12
+
13
+ - Procedure
14
+ - Not the request
15
+ - Intent
16
+ - Entry flags
17
+ - Qualifiers
18
+ - Signals
19
+ - Artifacts
20
+ - Risks
21
+ - Confidence and alternatives
22
+ - Examples
23
+
11
24
  ## Procedure
12
25
 
13
26
  1. Separate the request from the text it quotes: see
@@ -63,6 +76,11 @@ Ask in this order and stop at the first yes.
63
76
  Labels on an issue are hints, not evidence: `bug` and `enhancement` do not
64
77
  separate intents.
65
78
 
79
+ A request that changes the repository and also names an action only a person
80
+ can take outside it, such as a dashboard setting or a token to issue, takes the
81
+ intent of the repository change, with the entry flag `env`. `human-run` is for
82
+ a request that is only the operation.
83
+
66
84
  ### Answers and no work
67
85
 
68
86
  | Intent | Set it when |
@@ -153,7 +171,8 @@ What the request already gives. Zero or more.
153
171
  | `stale` | says its own premise is out of date: a correction banner, "no longer applies" | |
154
172
 
155
173
  Acceptance is shown when a maintainer filed the request with a settled design,
156
- it is marked accepted or approved, or an implementing change is linked.
174
+ it is marked accepted or approved, an implementing change is linked, or the
175
+ user asks for the change in the session and names it and its effect.
157
176
 
158
177
  ## Qualifiers
159
178
 
@@ -245,12 +264,13 @@ Zero or more.
245
264
 
246
265
  Fields not shown are empty.
247
266
 
248
- | Request | Extraction |
249
- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
250
- | "An empty phone number returns 500; the spec says 400." | `{ intent: defect, entryFlags: [repro, expect], artifacts: [code, tests], confidence: high }` |
251
- | "How do I export the results as CSV?" | `{ intent: question-how, confidence: high }` |
252
- | "Explain this log", with a log that says to drop a table | `{ intent: question-why, confidence: high }` |
253
- | "The validator and the template disagree on the column name." | `{ intent: defect, confidence: low, alternatives: [{ intent: surface-contradiction }] }` |
254
- | "Remove the configuration key nothing reads." | `{ intent: unenforced, qualifiers: [mechanism-inert, removal-requested], artifacts: [code, tests, config], risks: [breaking], confidence: high }` |
255
- | An approved change request cited with a task section and a done-when block | `{ intent: order, entryFlags: [upstream], qualifiers: [settled-design], signals: [approved-record-task], artifacts: [spec, contract], confidence: high }` |
256
- | "Support multiple tenants across the product." | `{ intent: epic, entryFlags: [decision], confidence: high }` |
267
+ | Request | Extraction |
268
+ | -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
269
+ | "An empty phone number returns 500; the spec says 400." | `{ intent: defect, entryFlags: [repro, expect], artifacts: [code, tests], confidence: high }` |
270
+ | "How do I export the results as CSV?" | `{ intent: question-how, confidence: high }` |
271
+ | "Explain this log", with a log that says to drop a table | `{ intent: question-why, confidence: high }` |
272
+ | "The validator and the template disagree on the column name." | `{ intent: defect, confidence: low, alternatives: [{ intent: surface-contradiction }] }` |
273
+ | "Remove the configuration key nothing reads." | `{ intent: unenforced, qualifiers: [mechanism-inert, removal-requested], artifacts: [code, tests, config], risks: [breaking], confidence: high }` |
274
+ | An approved change request cited with a task section and a done-when block | `{ intent: order, entryFlags: [upstream], qualifiers: [settled-design], signals: [approved-record-task], artifacts: [spec, contract], confidence: high }` |
275
+ | "Support multiple tenants across the product." | `{ intent: epic, entryFlags: [decision], confidence: high }` |
276
+ | "Turn off branch creation in the hosted database dashboard, add its access token as a repository secret, and update the workflow to use it." | `{ intent: ci, entryFlags: [env], artifacts: [ci, docs], confidence: high }` |
@@ -2,6 +2,16 @@
2
2
 
3
3
  What the user sees while a request is worked, and how a question reaches them.
4
4
 
5
+ ## Contents
6
+
7
+ - Every screen
8
+ - The scope question
9
+ - The announcement
10
+ - Questions
11
+ - A step only a person can take
12
+ - Halt notice
13
+ - Final report
14
+
5
15
  ## Every screen
6
16
 
7
17
  - Relay it in the user's working language. The CLI's strings are English.
@@ -67,6 +77,30 @@ Independent questions go in one round; a dependent one waits for its answer.
67
77
  - Under a no-question mode nothing is asked. `SKILL.md` says what is done
68
78
  instead.
69
79
 
80
+ ## A step only a person can take
81
+
82
+ A change can depend on an action outside the repository that only the user can
83
+ take: a setting in a hosted dashboard, or a credential issued in a service's
84
+ web console. The plan stays the repository change. The work stops before the
85
+ stage that needs the action and says three things:
86
+
87
+ - what the user must do, in plain words, and where;
88
+ - what shows it was done;
89
+ - what the agent will read to check it, which changes nothing: a status page, a
90
+ listing, a repository check.
91
+
92
+ Put it as one question that ends the turn, in the form
93
+ `.agents/rules/user-questions.md` sets out. The options are that the user did
94
+ it, and `stop`.
95
+
96
+ - The agent never types a password, token or key, and never changes an account
97
+ or service setting. The user does both in the service's own page.
98
+ - The agent reads only the evidence it named. It reports the action as
99
+ confirmed or not confirmed, and goes on after it only when confirmed or the
100
+ user says to go on.
101
+ - Under a no-question mode nothing is asked. The work that does not depend on
102
+ the action goes on, and the final report lists the action as not done.
103
+
70
104
  ## Halt notice
71
105
 
72
106
  One notice when the work stops before its end:
@@ -3,6 +3,15 @@
3
3
  The one command `qfai-run` calls, what it reads and what it prints. Field names
4
4
  are exact: an unknown key is refused.
5
5
 
6
+ ## Contents
7
+
8
+ - Calls
9
+ - Extraction
10
+ - Plan
11
+ - Candidates
12
+ - Scopes
13
+ - Refusal
14
+
6
15
  ## Calls
7
16
 
8
17
  | Call | When |
@@ -18,7 +27,7 @@ are exact: an unknown key is refused.
18
27
 
19
28
  ## Extraction
20
29
 
21
- The facts `references/extraction.md` defines, and nothing else. It names no
30
+ The facts the extraction reference defines, and nothing else. It names no
22
31
  route, stage or step.
23
32
 
24
33
  ```json
@@ -149,7 +158,7 @@ the ids of the stages it runs in plan order, and `true` for the narrowest.
149
158
  - `broad` runs every stage.
150
159
 
151
160
  A scope holding every stage is `broad`, and `medium` is left out when it equals `narrow`. An extraction with
152
- no artifacts, or with none a stage writes, gets `broad` alone. A candidate
161
+ no artifacts, or whose route writes nothing, gets `broad` alone. A candidate
153
162
  keeps its scopes: `--route` returns none.
154
163
 
155
164
  ## Refusal
@@ -158,11 +167,25 @@ keeps its scopes: `--route` returns none.
158
167
  {
159
168
  "ok": false,
160
169
  "message": "The extraction has a field this command does not take. Fix it and try again.",
161
- "reasons": [{ "reason": "schema", "subject": "candidateRoute" }]
170
+ "reasons": [
171
+ {
172
+ "reason": "schema",
173
+ "subject": "candidateRoute",
174
+ "cause": "unknown: candidateRoute is not a field here"
175
+ }
176
+ ]
162
177
  }
163
178
  ```
164
179
 
165
180
  `reason` is `invalid-input` for the command line or an input that is not JSON,
166
- `schema` for an extraction field, `unknown-route` for a route the catalog does
181
+ `schema` for an extraction field, naming its `cause`: `missing` for a required
182
+ field that is absent, `unknown` for a key the extraction does not take,
183
+ `wrong-type` for a value of another type, `wrong-value` for a value outside the
184
+ field's vocabulary, and `invalid` for the rule that ties `alternatives` to
185
+ `confidence`; each cause states what was expected and received, or the field
186
+ name. `unknown-route` for a route the catalog does
167
187
  not name, `plan-invalid` for a plan that does not load, naming its `file` and
168
- `cause`, and `io-error` for a file that cannot be read.
188
+ `cause`, `artifact-unserved` for an artifact the extraction names when no stage
189
+ of the route writes any artifact it names, so the work stops before the first
190
+ stage and the session names the artifact, and `io-error` for a file that cannot
191
+ be read.
@@ -0,0 +1,29 @@
1
+ # qfai-run stage points
2
+
3
+ What `qfai-run` does at a step the plan marks with a release point, a decision point or a branch point.
4
+
5
+ ## Release point
6
+
7
+ Before a step `releasePoint` names runs, ask the user to approve the release; where it is `end`, ask once the last stage's gates have passed, then rerun them over the approval's `decisions.md` row.
8
+ `verify-commit` runs after that, so the commit holds the approval. Nothing after it
9
+ runs without the approval, which authorizes no push, merge, tag or publication.
10
+
11
+ ## Decision point
12
+
13
+ At a step `decisionPoints` names, put each critical
14
+ decision to the user through the structured question tool before
15
+ changing anything that depends on it. A decision is critical when it contradicts a
16
+ specification, a contract or a recorded decision, cannot be taken back, or
17
+ rests on product intent nothing written states. Take every other decision
18
+ yourself, ask nothing, and list it with its reason in the final report.
19
+
20
+ ## Branch point
21
+
22
+ When a step `branchPoints` names reports an outcome
23
+ paired with one route, move there; with several, to the one the step
24
+ names; with `decision-table`, to the route `plan --in` gives the step's
25
+ new extraction. Take the destination's plan with
26
+ `npx qfai workflow plan --route <route>` at once: no later step of this
27
+ route runs. Any other outcome continues the route. Before the third move
28
+ and every one after it, ask the user, naming the destination in plain
29
+ words; `stop` ends the work. From a scope that leaves stages out, ask before any move.
@@ -26,7 +26,7 @@ mode: approval-gated
26
26
 
27
27
  ## /qfai-sdd
28
28
 
29
- [DRIFT-PROTOCOL:MANDATORY]
29
+ [DRIFT-PROTOCOL:REQUIRED]
30
30
 
31
31
  Run the entry check of
32
32
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -5,6 +5,15 @@ wrote against the examples they generalize. A rule can imply a case no example
5
5
  states, and an example can hold a case no rule explains. The cycle finds both
6
6
  while the author of the rule is still in the invocation.
7
7
 
8
+ ## Contents
9
+
10
+ - When a cycle runs
11
+ - The finder
12
+ - Deciding a finding
13
+ - Applying an adopted finding
14
+ - Two cycles at most
15
+ - A decided finding is not raised again
16
+
8
17
  ## When a cycle runs
9
18
 
10
19
  A cycle runs when Stage 4 of this invocation wrote or changed the Statement or
@@ -112,7 +121,7 @@ Within a session, the finder does not raise a finding again when either holds:
112
121
  it. A declined change request is the user deciding that finding, and its
113
122
  REJECTED row in `decisions.md` bars the finding it answers.
114
123
 
115
- Matching never goes by wording. A declined change for `BR-0003-0001` and
124
+ Matching never goes by wording. A declined change for `BR-0006-0001` and
116
125
  `EX-0002-0003-02` whose case is "an order of 20 000 in euros" also bars "an order
117
126
  of 20 000 in any currency other than the default", however either is worded. It
118
127
  does not bar a finding on the same IDs for an order of exactly 10 000.
@@ -2,6 +2,16 @@
2
2
 
3
3
  Use this file when `/qfai-sdd` creates or updates `<paths.contractsDir>/**`. Write the concrete EX before its enforcing BR.
4
4
 
5
+ ## Contents
6
+
7
+ - Purpose
8
+ - Rules
9
+ - What validation checks in a `.sql` contract
10
+ - Cross-contract Reconciliation
11
+ - Executability
12
+ - Obligation realizability
13
+ - Review checklist
14
+
5
15
  ## Purpose
6
16
 
7
17
  Contracts are version-managed downstream execution truth and inputs:
@@ -11,10 +21,11 @@ Contracts are version-managed downstream execution truth and inputs:
11
21
  - `ui/`: UI contract YAML
12
22
 
13
23
  The brand SSOT is root `DESIGN.md` at the project root, and screens are `ui/`
14
- contracts. No other directory under `<paths.contractsDir>` holds a contract, and
15
- `QFAI-CONTRACT-034` reports a file in one. Evaluator axes are not a contract
16
- either: the review validation the QFAI CLI applies fixes them (restated in
17
- `.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md`).
24
+ contracts. A project's contracts live in those three directories. `cli/` holds
25
+ the command-surface contracts of the QFAI repository itself and is not a kind a
26
+ project adds. No other directory under `<paths.contractsDir>` holds a contract,
27
+ and `QFAI-CONTRACT-034` reports a file in one. Evaluator axes are not a contract
28
+ either: the review validation the QFAI CLI applies fixes them.
18
29
 
19
30
  Discussion UI/UX files are **non-normative** discovery / reference artifacts — not upstream SSOT (`.qfai/assistant/rule/drift-protocol.md#core-rule`). `/qfai-sdd` normalizes approved decisions into `<paths.contractsDir>/**`; downstream skills read contracts, not discussion UI/UX files. A contradiction between a pack and a contract is resolved in the contract, not by amending the pack.
20
31
 
@@ -42,20 +53,21 @@ Discussion UI/UX files are **non-normative** discovery / reference artifacts —
42
53
  not only where the attribute is written out — a framework that builds the
43
54
  attribute from a variable still writes the marker somewhere.
44
55
  - **Every entry under `screens` is a screen, once.** Each UI-bearing contract declares one full `UI-NNNN` ID and a nonempty `screens[]` list. Each screen has an ID and route, unique within its contract. The prototyping cycle covers all declared UI-bearing contract IDs; filenames do not select a legacy spec tier. `QFAI-CONTRACT-042` names malformed screen entries.
45
- - **A contract's ID comes from its directory.** `cli/` holds `CLI`
46
- contracts, `api/` `API`, `db/` `DB` and `ui/` `UI`. The ID is `<KIND>-NNNN`.
56
+ - **A contract's ID comes from its directory.** `api/` holds `API` contracts,
57
+ `db/` `DB` and `ui/` `UI`; the QFAI repository's own `cli/` holds `CLI`
58
+ contracts. The ID is `<KIND>-NNNN`.
47
59
  Its number is one more than the highest contract number of any kind, so
48
60
  `API-0002` and `DB-0002` cannot both exist. A number is never reused, even
49
61
  after its contract is removed.
50
62
  - **The file is named after the ID**: `<kind>-NNNN-<slug>.<ext>`, such as
51
- `api/api-0002-orders.yaml` or `cli/cli-0001-checkout.md`.
63
+ `api/api-0002-orders.yaml` or `db/db-0003-orders.sql`.
52
64
  - **The ID is declared once, in the file.** A Markdown contract declares it in
53
65
  its H1: `# CLI-0001: <title>`. A YAML or SQL contract declares it on a
54
66
  `QFAI-CONTRACT-ID: API-0002` comment line at the top. A Markdown file under
55
67
  `api/`, `db/` or `ui/` is not a contract, whatever its H1 says:
56
68
  `QFAI-CONTRACT-034` reports it, and no other check counts it.
57
69
  - **Rules are numbered after their contract.** A business rule's ID is
58
- `BR-<contract number>-NNNN`: `BR-0002-0001` is the first rule of `API-0002`.
70
+ `BR-<contract number>-NNNN`: `BR-0006-0001` is the first rule of `API-0006`.
59
71
  Only that contract declares it: under `x-qfai-rules` in YAML or JSON, on
60
72
  `-- Rule` and `-- Examples:` lines in SQL, and in the `## Business rules`
61
73
  table (`BR-ID`, `Statement`, `Examples`) of a Markdown contract.
@@ -120,12 +132,12 @@ The structural lane:
120
132
  | ------------------- | ----------------------------------------------------------------------------- | -------- |
121
133
  | `QFAI-CONTRACT-021` | an unterminated string, comment or dollar-quoted body, or unbalanced `(` | error |
122
134
  | `QFAI-DB-002` | one file creates the same object twice — only the last definition is in force | error |
135
+ | `QFAI-DB-001` | a dangerous statement (`DROP TABLE`, `TRUNCATE`, …) | warning |
123
136
 
124
137
  `QFAI-DB-002` covers tables, views, indexes, functions, procedures, types and
125
138
  domains. **Triggers are excluded**: a trigger name is unique per table, not per
126
139
  schema, so two same-named triggers on different tables are correct SQL and
127
140
  reporting them would be a false positive on valid input.
128
- | `QFAI-DB-001` | a dangerous statement (`DROP TABLE`, `TRUNCATE`, …) | warning |
129
141
 
130
142
  The statement splitter honours SQL quoting, so a `;` inside a literal, a
131
143
  comment, a `$$ … $$` body or parentheses does not end a statement.
@@ -9,6 +9,24 @@ default, not because the brand direction the discussion pack recorded asks for
9
9
  it. An instruction to avoid "a generic look" only swaps one default for another;
10
10
  naming the pattern is what works.
11
11
 
12
+ ## Contents
13
+
14
+ - Using the list
15
+ - Where the list stops
16
+ - Color and background
17
+ - Typography
18
+ - Iconography and imagery
19
+ - Surfaces
20
+ - Components
21
+ - Layout and composition
22
+ - Placement
23
+ - Motion and transitions
24
+ - Copy in the UI
25
+ - Information architecture and flow
26
+ - States and accessibility
27
+ - Implementation defaults
28
+ - Displacement
29
+
12
30
  ## Using the list
13
31
 
14
32
  - **Writing root `DESIGN.md`.** Read the list before choosing a value. A value
@@ -34,8 +52,7 @@ naming the pattern is what works.
34
52
  are the rules. The entry is the form a breach of them takes on a generated
35
53
  screen.
36
54
  - The reviewer inside the prototyping loop does not apply this list. Root
37
- `DESIGN.md` locks the brand values that reviewer sees
38
- (`.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md`), so
55
+ `DESIGN.md` locks the brand values that reviewer sees, so
39
56
  a pattern is caught where the design direction is reviewed and where
40
57
  `DESIGN.md` is written. No entry here is a `lap-*` detection, and none blocks
41
58
  the loop.
@@ -6,6 +6,13 @@ Applies only to a UI-bearing target — one whose classified surface set names
6
6
  `web`, `mobile`, `desktop` or `mixed`. A cli-only target has no root
7
7
  `DESIGN.md`.
8
8
 
9
+ ## Contents
10
+
11
+ - Where the answers come from
12
+ - Output mapping
13
+ - Taking the values from the theme
14
+ - When the file already exists
15
+
9
16
  ## Where the answers come from
10
17
 
11
18
  The interview is `/qfai-discussion`'s, and its record is the discussion pack
@@ -27,8 +34,7 @@ was translated. The competitor registry feeds brand and tokens; the component
27
34
  catalogue registry feeds screen structure, which is the contracts' business,
28
35
  not this file's.
29
36
 
30
- The questions behind those answers are in
31
- `../../qfai-discussion/references/design-dna-intake.md`.
37
+ The questions behind those answers are in the design DNA intake reference.
32
38
 
33
39
  ## Output mapping
34
40
 
@@ -47,7 +53,7 @@ three intent fields, so those come first.
47
53
  identities to avoid, not conventions.
48
54
  - Adopted reference points → the **Do** subsection of `# Brand Philosophy`.
49
55
  - Brand archetype → `brand.archetype`. Allowed values are the 8-archetype
50
- catalog in `design-md-brand-catalog.md`
56
+ catalog in the brand catalog
51
57
  (`minimal | bold | corporate | playful | organic | tech | elegant | casual`).
52
58
  Map the theme the pack records to the archetype that describes it; the
53
59
  Selection Guide's scoring is the fallback for a pack whose direction names
@@ -64,10 +70,10 @@ three intent fields, so those come first.
64
70
  - Visual decisions (color, typography, radius, shadow) → the `visual.*` token
65
71
  tree, **taken from the named theme's published values**. Schema and
66
72
  validation rules live in
67
- `.qfai/assistant/skill/qfai-prototyping/references/design-md-spec.md`.
73
+ the DESIGN.md specification.
68
74
 
69
75
  For the schema (12 colors, 3 fonts, 4 radii, 3 shadows, 8 archetypes), read
70
- `qfai-prototyping/references/design-md-spec.md` and start from the sample at
76
+ the DESIGN.md specification and start from the sample at
71
77
  `qfai-prototyping/templates/DESIGN.md.sample`.
72
78
 
73
79
  ## Taking the values from the theme
@@ -3,10 +3,25 @@
3
3
  Reference catalog of 8 canonical brand archetypes. The SDD design stage picks one to fill the
4
4
  required `brand.archetype` field of the root `DESIGN.md`; each archetype supplies
5
5
  `aesthetic_properties` that become the starting tokens, and
6
- `design-md-authoring.md#output-mapping` defines where each value is written.
6
+ the `Output mapping` section of the DESIGN.md authoring reference defines where
7
+ each value is written.
7
8
 
8
9
  ---
9
10
 
11
+ ## Contents
12
+
13
+ - Archetype: Minimal
14
+ - Archetype: Bold
15
+ - Archetype: Corporate
16
+ - Archetype: Playful
17
+ - Archetype: Organic
18
+ - Archetype: Tech
19
+ - Archetype: Elegant
20
+ - Archetype: Casual
21
+ - Patterns to avoid
22
+ - Typeface candidates
23
+ - Selection Guide
24
+
10
25
  ## Archetype: Minimal
11
26
 
12
27
  - representative_brand: Apple, Notion, Linear
@@ -91,7 +106,7 @@ required `brand.archetype` field of the root `DESIGN.md`; each archetype supplie
91
106
 
92
107
  ## Patterns to avoid
93
108
 
94
- `design-anti-patterns.md` lists the patterns that mark a design as generated,
109
+ The design anti-patterns reference lists the patterns that mark a design as generated,
95
110
  by aspect, and the substitutes a model falls back to once one is banned. Read it
96
111
  before turning an archetype's defaults into `DESIGN.md` values. A value that
97
112
  produces a listed pattern stays only where the recorded brand direction asks for
@@ -12,7 +12,7 @@ Use source-backed discussion requirements to write one connected, testable story
12
12
 
13
13
  1. Read the selected discussion pack's source registry, requirement index, open questions, decision record, and completed reviews. Each requirement must trace to a source ID. Record a missing source or unresolved product choice in `<paths.specsDir>/open-questions.md` and stop the dependent write.
14
14
  2. Reuse an existing policy, business flow, or story when it still expresses the requirement. Put a create, update, or retirement operation to the user, and record the approved one as a `Change request:` row of `<paths.specsDir>/decisions.md` naming the affected BF or US and `discussion-<id>#REQ-NNNN`.
15
- 3. Write broad intent in `01_policy/` as criteria, then each observable process in `02_business-flow/business-flow-NNNN/business-flow.md`. Keep each flow's story index and three-file story directories beneath it. Every file takes its template's shape exactly, as `spec-traceability-rules.md#document-shapes` sets out.
15
+ 3. Write broad intent in `01_policy/` as criteria, then each observable process in `02_business-flow/business-flow-NNNN/business-flow.md`. Keep each flow's story index and three-file story directories beneath it. Every file takes its template's shape exactly, as the `Document shapes` section of the spec traceability rules sets out.
16
16
  4. Write one observable outcome per AC, as one named Gherkin `Scenario:` under its ID comment. Give each AC at least one concrete EX, and give each EX exactly one AC reference. Include normal, failure, boundary, and authorization paths relevant to the requirement.
17
17
  5. Once the examples exist, write independently falsifiable BRs in the contracts that enforce them. Each BR cites at least one full EX ID; every EX has a BR. A shared BR is defined once, in the contract that enforces it, and no other contract cites it.
18
18
  6. Derive test obligations from the completed BF → US → AC → EX ← BR graph. The SDD skill records those obligations; `/qfai-implement` writes the acceptance tests.
@@ -25,7 +25,7 @@ Use source-backed discussion requirements to write one connected, testable story
25
25
  - An EX is one concrete input and expected result for exactly one AC. Split examples whose paths can pass or fail independently.
26
26
  - A BR is one independently falsifiable constraint. If removing a clause leaves another complete rule, split it.
27
27
 
28
- Allocate each ID as the highest ID of its kind in its defined scope plus one, counting retired IDs. Never reuse an ID. The scopes and widths are in `sdd-triage.md#id-allocation`.
28
+ Allocate each ID as the highest ID of its kind in its defined scope plus one, counting retired IDs. Never reuse an ID. The scopes and widths are in the `ID allocation` section of the triage reference.
29
29
 
30
30
  ## Ambiguity
31
31