qfai 2.1.0 → 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 (184) hide show
  1. package/README.md +327 -55
  2. package/assets/defaults/agent-routing/qfai-triage.yml +9 -0
  3. package/assets/defaults/workflows/change-tooling.yml +0 -4
  4. package/assets/defaults/workflows/run-owned-cleanup.yml +12 -0
  5. package/assets/init/.claude/settings.json +27 -9
  6. package/assets/init/.codex/hooks.json +20 -8
  7. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +5 -0
  8. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +14 -1
  9. package/assets/init/.qfai/assistant/agent/product-experience-architect.md +4 -0
  10. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +7 -0
  11. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +29 -0
  12. package/assets/init/.qfai/assistant/agent/requirements-analyst.md +8 -0
  13. package/assets/init/.qfai/assistant/rule/communication.md +18 -8
  14. package/assets/init/.qfai/assistant/rule/constitution.md +5 -4
  15. package/assets/init/.qfai/assistant/rule/drift-protocol.md +72 -5
  16. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +72 -0
  17. package/assets/init/.qfai/assistant/rule/references/context-summary.md +30 -0
  18. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +42 -0
  19. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +23 -0
  20. package/assets/init/.qfai/assistant/rule/references/host-backstops.md +60 -0
  21. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +25 -0
  22. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +41 -0
  23. package/assets/init/.qfai/assistant/rule/references/reviewer-remit.md +35 -0
  24. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +48 -0
  25. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +39 -162
  26. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +14 -145
  27. package/assets/init/.qfai/assistant/rule/stage-cost.md +1 -1
  28. package/assets/init/.qfai/assistant/rule/test-layers.md +42 -0
  29. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +6 -1
  30. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +11 -45
  31. package/assets/init/.qfai/assistant/skill/qfai-configure/references/principles.md +25 -0
  32. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +1 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +12 -9
  34. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +2 -4
  35. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/platform_baselines.md +11 -0
  36. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/review_audit_playbook.md +11 -0
  37. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +13 -42
  38. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +0 -16
  39. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -1
  40. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +16 -88
  41. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +58 -0
  42. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +42 -0
  43. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +17 -4
  44. package/assets/init/.qfai/assistant/skill/qfai-implement/references/credential-reuse.md +9 -0
  45. package/assets/init/.qfai/assistant/skill/qfai-implement/references/cross-spec-ownership.md +41 -0
  46. package/assets/init/.qfai/assistant/skill/qfai-implement/references/oracle-strength.md +6 -1
  47. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +9 -1
  48. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +47 -1
  49. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +4 -3
  50. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +4 -4
  51. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +16 -10
  52. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +10 -260
  53. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +273 -0
  54. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +5 -4
  55. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/design-md-spec.md +14 -5
  56. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +10 -0
  57. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +1 -1
  58. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +3 -4
  59. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +12 -5
  60. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +33 -4
  61. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +34 -36
  62. package/assets/init/.qfai/assistant/skill/qfai-run/references/evidence-delivery.md +322 -0
  63. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +67 -24
  64. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +246 -5
  65. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +29 -5
  66. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +43 -0
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +5 -4
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +10 -1
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +22 -9
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +41 -6
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +11 -5
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md +17 -2
  73. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +10 -2
  74. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +34 -9
  75. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +4 -4
  76. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
  77. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +177 -7
  78. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +29 -5
  79. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +130 -1
  80. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +4 -30
  81. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +39 -2
  82. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/db-contract.sample.sql +2 -2
  83. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +52 -5
  84. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/cli/cli-NNNN-title.md +2 -2
  85. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -1
  86. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +7 -0
  87. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +30 -20
  88. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +6 -5
  89. package/assets/init/.qfai/assistant/skill/qfai-verify/references/context-load.md +9 -6
  90. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +92 -13
  91. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +37 -31
  92. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/config.toml +2 -4
  93. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/mcp-config.json +9 -5
  94. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/.mcp.json +1 -2
  95. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/config.toml +3 -3
  96. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/mcp-config.json +11 -8
  97. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/config.toml +1 -1
  98. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/mcp-config.json +7 -3
  99. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +17 -7
  100. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +126 -13
  101. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +3 -2
  102. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +1 -0
  103. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +2 -0
  104. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +12 -4
  105. package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +1 -1
  106. package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +7 -4
  107. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +11 -1
  108. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +2 -0
  109. package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +2 -2
  110. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +3 -3
  111. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +2 -2
  112. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +4 -3
  113. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +6 -3
  114. package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +4 -3
  115. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +3 -3
  116. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +9 -6
  117. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +1 -1
  118. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +4 -3
  119. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +42 -6
  120. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +2 -0
  121. package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +22 -2
  122. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +18 -14
  123. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +4 -3
  124. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +4 -0
  125. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +1 -3
  126. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +11 -0
  127. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +4 -0
  128. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +4 -0
  129. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +10 -0
  130. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +37 -11
  131. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +5 -4
  132. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +33 -23
  133. package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +5 -3
  134. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +2 -0
  135. package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +4 -0
  136. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +13 -4
  137. package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +8 -5
  138. package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +86 -0
  139. package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +2 -0
  140. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +6 -3
  141. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +9 -5
  142. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +39 -6
  143. package/assets/init/.qfai/assistant/step/verify-external/STEP.md +5 -2
  144. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +10 -2
  145. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +1 -0
  146. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +7 -5
  147. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +136 -28
  148. package/assets/init/.qfai/waivers.yml +1 -1
  149. package/assets/init/root/.agents/rules/ai-readable-markdown.md +98 -0
  150. package/assets/init/root/.agents/rules/api-budget.md +191 -13
  151. package/assets/init/root/.agents/rules/documentation-clarity.md +192 -35
  152. package/assets/init/root/.agents/rules/grilling.md +4 -4
  153. package/assets/init/root/.agents/rules/interface-clarity.md +5 -5
  154. package/assets/init/root/.agents/rules/minimal-implementation.md +11 -3
  155. package/assets/init/root/.agents/rules/reminders.json +27 -14
  156. package/assets/init/root/.agents/rules/session-feedback.md +136 -0
  157. package/assets/init/root/.agents/rules/temporary-files.md +47 -5
  158. package/assets/init/root/.agents/rules/untrusted-content.md +3 -3
  159. package/assets/init/root/.agents/rules/user-questions.md +74 -36
  160. package/assets/init/root/.gitattributes +9 -0
  161. package/assets/init/root/.github/workflows/qfai-docs.yml +44 -12
  162. package/assets/init/root/.github/workflows/qfai-tests.yml +58 -15
  163. package/assets/init/root/.github/workflows/qfai-validate.yml +49 -42
  164. package/assets/init/root/AGENTS.md +23 -21
  165. package/assets/mdschema/story/03_contract/tech.mdschema.yml +7 -3
  166. package/assets/sandbox-templates/default-deny.yaml +9 -5
  167. package/assets/schemas/workflow/extraction.schema.json +85 -5
  168. package/assets/schemas/workflow/plan.schema.json +9 -2
  169. package/assets/scripts/check-mdschema.mjs +172 -5
  170. package/assets/uix-rev/comparison-review.md +1 -1
  171. package/assets/uix-rev/contracts-review.md +1 -2
  172. package/dist/cli/index.cjs +6499 -7688
  173. package/dist/cli/index.cjs.map +1 -1
  174. package/dist/cli/index.mjs +6449 -7641
  175. package/dist/cli/index.mjs.map +1 -1
  176. package/dist/index.cjs +5548 -7823
  177. package/dist/index.cjs.map +1 -1
  178. package/dist/index.d.cts +40 -666
  179. package/dist/index.d.ts +40 -666
  180. package/dist/index.mjs +5397 -7648
  181. package/dist/index.mjs.map +1 -1
  182. package/docs/MIGRATION-2.0.0.md +1 -1
  183. package/package.json +5 -7
  184. package/assets/init/root/CLAUDE.md +0 -45
@@ -5,6 +5,15 @@ QFAI 2.x does not read the old spec-pack layout. A project that keeps spec packs
5
5
  must stay on a pinned 1.x release. To upgrade, migrate the project before using
6
6
  the 2.x validation and authoring workflow.
7
7
 
8
+ ## Contents
9
+
10
+ - Prepare
11
+ - Run the bundled steps
12
+ - Write boundary
13
+ - Resolve the reports
14
+ - Install and check the free-text entry
15
+ - Former migration memos
16
+
8
17
  ## Prepare
9
18
 
10
19
  1. Commit the current project state. The migration deletes every 1.x file
@@ -31,265 +40,6 @@ the 2.x validation and authoring workflow.
31
40
  Do not run `npx qfai init --force` to migrate. It can write beyond the migration
32
41
  scripts' allowed paths and replace local edits.
33
42
 
34
- ## Place stories and rules
35
-
36
- The AI writes `tmp/qfai-migration/plan.yaml` before running
37
- step 4. `plan.yaml` may be written before step 1, because only steps 4 and 7
38
- read it and a contract is named by the path it has in the contracts directory
39
- before step 3, which is also a key of `contract-map.json` once step 3 has run.
40
-
41
- The plan states the decisions the scripts cannot make. `flows` says which
42
- business flow holds each old story. `rules` says which existing contract
43
- enforces each old business rule, or that it enforces none. The optional
44
- `examples` list places an example whose criterion the test cases leave open.
45
- Flow order and story order determine the new IDs.
46
-
47
- - **`from`.** A `from` value identifies an old flow to continue; omit it for a
48
- new flow. It is the exact title of any H2 section of the old
49
- `_policies/04_Business-Flow.md`, and no other H2 of that file has the same
50
- title. For the unnamed opening flow, which is the text before the first
51
- `CHG-` heading or the whole file where it has none, use the reserved value
52
- `_policies/04_Business-Flow.md`. Several flows may continue the same section,
53
- and each takes that section's prose and diagram. If `from` is omitted, the
54
- script writes a template flow and reports that its diagram needs a person.
55
- - **`criteria`.** An old criterion belongs to the story its `Parent:` line
56
- names or, where it has none, to the story its row of the criteria catalog
57
- table names in the `US Ref`, `US-Refs` or `Maps To` column. Add `criteria`
58
- to a story only when the criterion has no such reference, the reference
59
- names several stories, or the two disagree.
60
- - **`contract`.** A contract path is relative to the configured contracts
61
- directory, lies under `cli/`, `api/`, `db/` or `ui/`, and names the contract
62
- file as it is before step 3 renames it. A Markdown file under `api/`, `db/`
63
- or `ui/` and a file under `design/` hold no contract, so a rule cannot be
64
- placed in one.
65
- - **`binds: none` and `retire`.** A rule with no contract takes one of these
66
- instead of `contract`. `binds: none` is allowed only where the rule's
67
- `Contract-Refs` cell is `-`. `retire` takes a reason. Step 7 removes such a
68
- rule from its `04_Business-Rules.md`, lists it under `## Operations` with
69
- its old ID and, for `retire`, the reason, and gives it no new ID.
70
- - **`examples`.** An entry names an old example ID and a `criterion`, one of
71
- the old criterion IDs that the `AC-Refs` of the test cases citing the example
72
- name. Step 4 places the example under that criterion's story, and its test
73
- cases enter the ID map, so that step 8 rewrites their annotations.
74
-
75
- ```yaml
76
- flows:
77
- - title: Place an order
78
- stories:
79
- - id: US-0001-0001
80
- criteria: [AC-0001-0001]
81
- examples:
82
- - id: EX-0001-0002
83
- criterion: AC-0001-0001
84
- rules:
85
- - id: BR-0001-0001
86
- contract: api/orders.yaml
87
- - id: BR-0001-0002
88
- binds: none
89
- - id: BR-0001-0003
90
- retire: The payment provider enforces this limit.
91
- ```
92
-
93
- Use IDs from the old files in this plan. Assign each old story, rule, example
94
- and criterion at most once. A `from` value that matches no old flow or matches
95
- several, an invalid plan, a duplicate assignment, an `examples` criterion that
96
- none of the citing test cases names, a rule with none or more than one of
97
- `contract`, `binds` and `retire`, or a contract path that is outside the four
98
- contract directories or names no contract stops step 4 before writing. Check
99
- the step-4 dry run before accepting its numbering. Step 4 writes
100
- `tmp/qfai-migration/id-map.json` once, and later steps use
101
- that map. Write the `examples` entries and the rule marks before step 4: once
102
- the map exists, an `examples` entry and a mark on a rule the map holds are
103
- refused. A mark on a rule step 4 left unplaced is still accepted while a spec
104
- pack is left. Place any other unplaced content in the new tree through `/qfai-sdd`. While the
105
- map exists and no spec pack is left, steps 4 and 7 read no plan, so a missing or
106
- rewritten `plan.yaml` stops nothing.
107
-
108
- ## Retired configuration keys
109
-
110
- Three keys of `qfai.config.yaml` no longer exist in 2.x. Each is handled by the
111
- step named here:
112
-
113
- | Key | What the migration does |
114
- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
115
- | `validation.traceability.scMustHaveTest` | Step 1 removes it and lists it under `## Operations` |
116
- | `validation.traceability.unknownContractIdSeverity` | Step 1 removes it and lists it under `## Operations` |
117
- | `prototyping.primarySpecId` | Step 3 replaces it with `prototyping.primaryUiContract` where exactly one UI contract is tied to that spec |
118
-
119
- Step 1 also removes a `validation.traceability` or `validation` mapping that
120
- the removal leaves empty. Steps 1 to 3 run although the configuration loader
121
- reports these keys. Steps 4 to 12 refuse with exit 2 before writing, naming the
122
- key, while `qfai.config.yaml` still holds one of the three. That refusal does
123
- not mean an earlier step has not run.
124
-
125
- A UI contract is tied to a spec when the contract IDs named by the
126
- `Contract-Refs` of that spec's business rules translate, through the contract
127
- map, to one UI contract. Step 3 lists the replacement under `## Operations`.
128
- Where `prototyping.primaryUiContract` is already set, step 3 removes the old key
129
- instead. Where no UI contract is tied, more than one is, or the spec pack is
130
- gone, step 3 leaves `prototyping.primarySpecId` and lists it under
131
- `## For a person` with its old value, and exits 3. Replace it by hand with
132
- `prototyping.primaryUiContract: UI-NNNN` naming the contract. Steps 4 to 12 then
133
- run.
134
-
135
- When a step cannot load `qfai.config.yaml` for any other reason, it exits 2
136
- before writing and prints on standard error the message of each configuration
137
- issue, one per line.
138
-
139
- ## Contract IDs
140
-
141
- Step 3 gives every contract file that has no 2.x contract ID one, and renames
142
- the file to match:
143
-
144
- | Old contract | Declares | New ID | New file |
145
- | -------------------------- | -------------- | -------- | -------------------------- |
146
- | `cli/orders.md` | nothing | CLI-0001 | `cli/cli-0001-orders.md` |
147
- | `api/api-0001-orders.yaml` | `CON-API-0001` | API-0002 | `api/api-0002-orders.yaml` |
148
- | `db/db-0001-orders.sql` | `CON-DB-0001` | DB-0003 | `db/db-0003-orders.sql` |
149
-
150
- - Numbers run across all contracts, in the order CLI, API, DB, UI, then by
151
- the old number, then by path. No two contracts share a number.
152
- - The new ID replaces the old one in the file's declaration: the H1 of a
153
- Markdown contract, as `# CLI-0001: <title>`, and the `QFAI-CONTRACT-ID` line
154
- of any other. The old IDs in `-- Depends on:` and `x-qfai-depends-on` become
155
- the new ones, and a YAML contract keeps its `x-qfai-depends-on` list on one
156
- line.
157
- - `contracts.md` becomes one index table listing every contract. The old
158
- index's other sections are reported for a person.
159
- - `tmp/qfai-migration/contract-map.json` records each old
160
- path and old ID with the new ones, and step 4 copies it into the ID map.
161
- - Step 7 writes the new IDs into rule statements, and step 8 changes a
162
- `QFAI:CON-API-0001` test annotation to `QFAI:API-0002`.
163
-
164
- Step 3 gives no ID to a file that is not a 2.x contract, and does not write it
165
- into the new tree:
166
-
167
- | Old file | Why it is not a contract |
168
- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
169
- | A Markdown file under `api/`, `db/` or `ui/` | Those directories hold OpenAPI YAML or JSON, SQL and UI YAML contracts |
170
- | Any file under `design/` | The directory no longer exists: the brand belongs in the root `DESIGN.md`, a screen in a `ui/` contract |
171
-
172
- Step 3 deletes each one, `design/` as one directory, and lists each file under
173
- `## For a person`. Rewrite what the file stated, from git history, in the form
174
- its row names.
175
-
176
- The old `design/prototype-handoff.yaml` is now
177
- `.qfai/prototype/final/handoff.json`, which `/qfai-prototyping` writes when
178
- the user confirms the prototype. The migration does not convert
179
- the old file into it.
180
-
181
- Step 3 also replaces every old `CON-*` ID that the contract map translates inside
182
- the contract files it writes, wherever it stands in the file, and lists none of
183
- them. It writes nothing outside those files. An old ID the map cannot translate,
184
- such as an ID no contract declared or that several declared, stays as written
185
- and is reported for a person with its file and line, as is a UI marker in
186
- application code.
187
-
188
- Step 3 groups its `## For a person` items under `### Content` and
189
- `### Identifiers`. `### Content` comes first and holds what a person rewrites
190
- or decides. `### Identifiers` holds an item that only pairs an old ID with its
191
- new one, such as a changed constraint ID. A group with no item is not printed.
192
-
193
- Step 3 writes a `routing:` override into `qfai.config.yaml` only for an entry
194
- of `agent-routing.yml` that differs from the installed default. It writes none
195
- for an entry equal to a default or to an entry a 1.x release shipped. Step 3
196
- lists each routing entry it does write under `## For a person`, with its name
197
- and a warning that a routing entry copied from a 1.x manifest hides the roles
198
- the 2.x skills declare.
199
-
200
- ## Business rules
201
-
202
- Rules are numbered per contract, `BR-<contract number>-NNNN` from `0001` in plan
203
- order: the first rule step 4 places in API-0002 is BR-0002-0001. Step 7 writes
204
- each rule into its contract in the form the contract's format takes:
205
-
206
- | Contract format | Where the rule goes |
207
- | --------------- | ----------------------------------------------------------------------- |
208
- | Markdown | A row of the `## Business rules` table: BR-ID, Statement and Examples |
209
- | YAML or JSON | An entry `{ id, statement, examples }` of the top-level `x-qfai-rules:` |
210
- | SQL | A `-- Rule BR-0002-0001: <statement>` line, then an `-- Examples:` line |
211
-
212
- A Markdown contract without a `## Business rules` section gets one as its last
213
- section. A rule's examples are the new IDs of the examples that cited it. A
214
- rule written as a heading section takes the value of its `Rule` field as its
215
- statement, and a SQL contract holds that statement on one line.
216
-
217
- ## Documents in their template's shape
218
-
219
- Each story-tree document the steps write takes the shape of its `qfai-sdd`
220
- template, which is the shape the document schema checks:
221
-
222
- | Documents | Step |
223
- | --------------------------------------------------------------------------------------- | ---- |
224
- | `decisions.md` and `open-questions.md` rows | 2 |
225
- | `objective.md`, `initiative.md`, `principle.md`, `glossary.md` and `constraint.md` | 3 |
226
- | `contracts.md` and `tech.md` | 3 |
227
- | Markdown contracts under `cli/` | 3 |
228
- | `business-flows.md`, `business-flow.md`, `user-stories.md` and each story's three files | 4 |
229
- | Examples turned from test cases | 5 |
230
-
231
- Content that does not fit that shape is listed under `## For a person`, and the
232
- step exits 3:
233
-
234
- - Step 3 leaves it out of the policy file, `tech.md` or CLI contract, and names the source
235
- file and, where one fits, the template section that takes the content once a
236
- person rewrites it. The source file is deleted, so the content is read from
237
- git history.
238
- - Step 3 also leaves as it is a policy file or `tech.md` that already exists
239
- and differs from what it would write.
240
- - A constraint row keeps only its ID, Constraint and Rationale. Step 3 lists
241
- an Impact column, whose content belongs to the contract or `tech.md` that
242
- owns it, and a row that names a file, a command or a rule ID, to be rewritten
243
- in plain words.
244
- - Step 3 numbers each constraint section from 01 in table order, and lists
245
- every ID that changed with the ID that replaces it.
246
- - Steps 4 and 5 write a story sentence or an example cell of another form as it
247
- stands, for a person to rewrite.
248
- - Step 4 lists every business flow, so that a person writes its alternate and
249
- exception paths.
250
-
251
- The steps do not write these into the new tree. Each stays in its old spec-pack
252
- file, which stays in the pack while any of its content is unplaced and is then
253
- deleted, kept in git history only:
254
-
255
- - a spec pack's scope and source provenance;
256
- - a story block's `Parent`, `Source` and `Flow` fields;
257
- - a criterion's `# Parent:` line, since its directory names the story;
258
- - a `Background:`, any scenario after a criterion's first named one, and a
259
- `Scenario Outline:`, each listed for a person.
260
-
261
- Step 3 writes no structure document. It routes the old `catalog/structure.md`
262
- section by section:
263
-
264
- | Old content | New home |
265
- | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
266
- | An entrypoint with a smoke or skeleton command | A `- Skeleton:` line in `tech.md`'s Standard commands |
267
- | A layer row of an `## Architecture` or `## Architecture constraints` table of Layer, Responsibility and Depends on columns, naming no path | The `## Architecture` table of `tech.md` |
268
- | The `ui_paths:` globs of `## UI surface paths` | `uiux.surfacePaths` in `qfai.config.yaml`, if unset |
269
- | Anything else | `## For a person` |
270
-
271
- Step 3 writes the moved layers in the shape of the Architecture section: a
272
- `flowchart TD` with a node per layer and an edge per dependency, then the table
273
- with the rows ordered from the uppermost layer down. Where the rows cannot be
274
- ordered, because a layer depends on one that has no row or layers depend on each
275
- other, none of them moves: the section is listed under `## For a person` with
276
- the reason, and `tech.md` keeps the template's Architecture section.
277
-
278
- Step 3 writes each Markdown contract under `cli/` in the shape of the CLI
279
- contract template: its `# CLI-0001: <title>` heading, `## Ownership boundary`
280
- and a `## Business rules` table, and nothing else.
281
-
282
- - An old `## Ownership boundary` of one to three paragraphs that name no rule is
283
- kept as it stands.
284
- - Where the old contract has none, the section holds the template's placeholder,
285
- and the contract is listed for a person to write it.
286
- - The text before the first section, lines such as `Status:` or `Rule refs:`,
287
- and every other section are left out. Each is listed with the old file.
288
-
289
- Step 7 then writes the contract's rules into that table. A rule whose statement
290
- names another rule is written and listed for a person, because a CLI contract's
291
- rule cites only examples.
292
-
293
43
  ## Run the bundled steps
294
44
 
295
45
  For each row, run the script with `--dry-run`, read its operations, and then run
@@ -495,7 +245,7 @@ installed package's copy. A copy the project changed is replaced, an untracked
495
245
  file and an uncommitted edit included, and the replacement is listed under
496
246
  `## Operations`. A skill the package does not ship and
497
247
  `.qfai/assistant/skill.local/` are left alone. Step 11 also adds each missing
498
- host skill link and the `.qfai/run/` line of the managed `.gitignore` block. A
248
+ host skill link and brings the managed `.gitignore` block up to date. A
499
249
  path it cannot write is reported with the reason. It leaves `AGENTS.md` and
500
250
  `CLAUDE.md` as they are, a line an earlier `npx qfai init` wrote included.
501
251
 
@@ -0,0 +1,273 @@
1
+ # Place stories and write the documents
2
+
3
+ What the bundled steps need from a person before they place stories and
4
+ rules, and the shape of what steps 1 to 7 write: the plan, the retired
5
+ configuration keys, the contract numbers, the business rules and the story-tree
6
+ documents.
7
+
8
+ ## Contents
9
+
10
+ - Place stories and rules
11
+ - Retired configuration keys
12
+ - Contract IDs
13
+ - Business rules
14
+ - Documents in their template's shape
15
+
16
+ ## Place stories and rules
17
+
18
+ The AI writes `tmp/qfai-migration/plan.yaml` before running
19
+ step 4. `plan.yaml` may be written before step 1, because only steps 4 and 7
20
+ read it and a contract is named by the path it has in the contracts directory
21
+ before step 3, which is also a key of `contract-map.json` once step 3 has run.
22
+
23
+ The plan states the decisions the scripts cannot make. `flows` says which
24
+ business flow holds each old story. `rules` says which existing contract
25
+ enforces each old business rule, or that it enforces none. The optional
26
+ `examples` list places an example whose criterion the test cases leave open.
27
+ Flow order and story order determine the new IDs.
28
+
29
+ - **`from`.** A `from` value identifies an old flow to continue; omit it for a
30
+ new flow. It is the exact title of any H2 section of the old
31
+ `_policies/04_Business-Flow.md`, and no other H2 of that file has the same
32
+ title. For the unnamed opening flow, which is the text before the first
33
+ `CHG-` heading or the whole file where it has none, use the reserved value
34
+ `_policies/04_Business-Flow.md`. Several flows may continue the same section,
35
+ and each takes that section's prose and diagram. If `from` is omitted, the
36
+ script writes a template flow and reports that its diagram needs a person.
37
+ - **`criteria`.** An old criterion belongs to the story its `Parent:` line
38
+ names or, where it has none, to the story its row of the criteria catalog
39
+ table names in the `US Ref`, `US-Refs` or `Maps To` column. Add `criteria`
40
+ to a story only when the criterion has no such reference, the reference
41
+ names several stories, or the two disagree.
42
+ - **`contract`.** A contract path is relative to the configured contracts
43
+ directory, lies under `cli/`, `api/`, `db/` or `ui/`, and names the contract
44
+ file as it is before step 3 renames it. A Markdown file under `api/`, `db/`
45
+ or `ui/` and a file under `design/` hold no contract, so a rule cannot be
46
+ placed in one.
47
+ - **`binds: none` and `retire`.** A rule with no contract takes one of these
48
+ instead of `contract`. `binds: none` is allowed only where the rule's
49
+ `Contract-Refs` cell is `-`. `retire` takes a reason. Step 7 removes such a
50
+ rule from its `04_Business-Rules.md`, lists it under `## Operations` with
51
+ its old ID and, for `retire`, the reason, and gives it no new ID.
52
+ - **`examples`.** An entry names an old example ID and a `criterion`, one of
53
+ the old criterion IDs that the `AC-Refs` of the test cases citing the example
54
+ name. Step 4 places the example under that criterion's story, and its test
55
+ cases enter the ID map, so that step 8 rewrites their annotations.
56
+
57
+ ```yaml
58
+ flows:
59
+ - title: Place an order
60
+ stories:
61
+ - id: US-0001-0001
62
+ criteria: [AC-0001-0001]
63
+ examples:
64
+ - id: EX-0001-0002
65
+ criterion: AC-0001-0001
66
+ rules:
67
+ - id: BR-0006-0001
68
+ contract: api/orders.yaml
69
+ - id: BR-0006-0002
70
+ binds: none
71
+ - id: BR-0006-0003
72
+ retire: The payment provider enforces this limit.
73
+ ```
74
+
75
+ Use IDs from the old files in this plan. Assign each old story, rule, example
76
+ and criterion at most once. A `from` value that matches no old flow or matches
77
+ several, an invalid plan, a duplicate assignment, an `examples` criterion that
78
+ none of the citing test cases names, a rule with none or more than one of
79
+ `contract`, `binds` and `retire`, or a contract path that is outside the four
80
+ contract directories or names no contract stops step 4 before writing. Check
81
+ the step-4 dry run before accepting its numbering. Step 4 writes
82
+ `tmp/qfai-migration/id-map.json` once, and later steps use
83
+ that map. Write the `examples` entries and the rule marks before step 4: once
84
+ the map exists, an `examples` entry and a mark on a rule the map holds are
85
+ refused. A mark on a rule step 4 left unplaced is still accepted while a spec
86
+ pack is left. Place any other unplaced content in the new tree through `/qfai-sdd`. While the
87
+ map exists and no spec pack is left, steps 4 and 7 read no plan, so a missing or
88
+ rewritten `plan.yaml` stops nothing.
89
+
90
+ ## Retired configuration keys
91
+
92
+ Three keys of `qfai.config.yaml` no longer exist in 2.x. Each is handled by the
93
+ step named here:
94
+
95
+ | Key | What the migration does |
96
+ | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
97
+ | `validation.traceability.scMustHaveTest` | Step 1 removes it and lists it under `## Operations` |
98
+ | `validation.traceability.unknownContractIdSeverity` | Step 1 removes it and lists it under `## Operations` |
99
+ | `prototyping.primarySpecId` | Step 3 replaces it with `prototyping.primaryUiContract` where exactly one UI contract is tied to that spec |
100
+
101
+ Step 1 also removes a `validation.traceability` or `validation` mapping that
102
+ the removal leaves empty. Steps 1 to 3 run although the configuration loader
103
+ reports these keys. Steps 4 to 12 refuse with exit 2 before writing, naming the
104
+ key, while `qfai.config.yaml` still holds one of the three. That refusal does
105
+ not mean an earlier step has not run.
106
+
107
+ A UI contract is tied to a spec when the contract IDs named by the
108
+ `Contract-Refs` of that spec's business rules translate, through the contract
109
+ map, to one UI contract. Step 3 lists the replacement under `## Operations`.
110
+ Where `prototyping.primaryUiContract` is already set, step 3 removes the old key
111
+ instead. Where no UI contract is tied, more than one is, or the spec pack is
112
+ gone, step 3 leaves `prototyping.primarySpecId` and lists it under
113
+ `## For a person` with its old value, and exits 3. Replace it by hand with
114
+ `prototyping.primaryUiContract: UI-NNNN` naming the contract. Steps 4 to 12 then
115
+ run.
116
+
117
+ When a step cannot load `qfai.config.yaml` for any other reason, it exits 2
118
+ before writing and prints on standard error the message of each configuration
119
+ issue, one per line.
120
+
121
+ ## Contract IDs
122
+
123
+ Step 3 gives every contract file that has no 2.x contract ID one, and renames
124
+ the file to match:
125
+
126
+ | Old contract | Declares | New ID | New file |
127
+ | -------------------------- | -------------- | -------- | -------------------------- |
128
+ | `cli/orders.md` | nothing | CLI-0001 | `cli/cli-0001-orders.md` |
129
+ | `api/api-0001-orders.yaml` | `CON-API-0001` | API-0002 | `api/api-0002-orders.yaml` |
130
+ | `db/db-0001-orders.sql` | `CON-DB-0001` | DB-0003 | `db/db-0003-orders.sql` |
131
+
132
+ - Numbers run across all contracts, in the order CLI, API, DB, UI, then by
133
+ the old number, then by path. No two contracts share a number.
134
+ - The new ID replaces the old one in the file's declaration: the H1 of a
135
+ Markdown contract, as `# CLI-0001: <title>`, and the `QFAI-CONTRACT-ID` line
136
+ of any other. The old IDs in `-- Depends on:` and `x-qfai-depends-on` become
137
+ the new ones, and a YAML contract keeps its `x-qfai-depends-on` list on one
138
+ line.
139
+ - `contracts.md` becomes one index table listing every contract. The old
140
+ index's other sections are reported for a person.
141
+ - `tmp/qfai-migration/contract-map.json` records each old
142
+ path and old ID with the new ones, and step 4 copies it into the ID map.
143
+ - Step 7 writes the new IDs into rule statements, and step 8 changes a
144
+ `QFAI:CON-API-0001` test annotation to `QFAI:API-0002`.
145
+
146
+ Step 3 gives no ID to a file that is not a 2.x contract, and does not write it
147
+ into the new tree:
148
+
149
+ | Old file | Why it is not a contract |
150
+ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
151
+ | A Markdown file under `api/`, `db/` or `ui/` | Those directories hold OpenAPI YAML or JSON, SQL and UI YAML contracts |
152
+ | Any file under `design/` | The directory no longer exists: the brand belongs in the root `DESIGN.md`, a screen in a `ui/` contract |
153
+
154
+ Step 3 deletes each one, `design/` as one directory, and lists each file under
155
+ `## For a person`. Rewrite what the file stated, from git history, in the form
156
+ its row names.
157
+
158
+ The old `design/prototype-handoff.yaml` is now
159
+ `.qfai/prototype/final/handoff.json`, which `/qfai-prototyping` writes when
160
+ the user confirms the prototype. The migration does not convert
161
+ the old file into it.
162
+
163
+ Step 3 also replaces every old `CON-*` ID that the contract map translates inside
164
+ the contract files it writes, wherever it stands in the file, and lists none of
165
+ them. It writes nothing outside those files. An old ID the map cannot translate,
166
+ such as an ID no contract declared or that several declared, stays as written
167
+ and is reported for a person with its file and line, as is a UI marker in
168
+ application code.
169
+
170
+ Step 3 groups its `## For a person` items under `### Content` and
171
+ `### Identifiers`. `### Content` comes first and holds what a person rewrites
172
+ or decides. `### Identifiers` holds an item that only pairs an old ID with its
173
+ new one, such as a changed constraint ID. A group with no item is not printed.
174
+
175
+ Step 3 writes a `routing:` override into `qfai.config.yaml` only for an entry
176
+ of `agent-routing.yml` that differs from the installed default. It writes none
177
+ for an entry equal to a default or to an entry a 1.x release shipped. Step 3
178
+ lists each routing entry it does write under `## For a person`, with its name
179
+ and a warning that a routing entry copied from a 1.x manifest hides the roles
180
+ the 2.x skills declare.
181
+
182
+ ## Business rules
183
+
184
+ Rules are numbered per contract, `BR-<contract number>-NNNN` from `0001` in plan
185
+ order: the first rule step 4 places in API-0006 is BR-0006-0001. Step 7 writes
186
+ each rule into its contract in the form the contract's format takes:
187
+
188
+ | Contract format | Where the rule goes |
189
+ | --------------- | ----------------------------------------------------------------------- |
190
+ | Markdown | A row of the `## Business rules` table: BR-ID, Statement and Examples |
191
+ | YAML or JSON | An entry `{ id, statement, examples }` of the top-level `x-qfai-rules:` |
192
+ | SQL | A `-- Rule BR-0006-0001: <statement>` line, then an `-- Examples:` line |
193
+
194
+ A Markdown contract without a `## Business rules` section gets one as its last
195
+ section. A rule's examples are the new IDs of the examples that cited it. A
196
+ rule written as a heading section takes the value of its `Rule` field as its
197
+ statement, and a SQL contract holds that statement on one line.
198
+
199
+ ## Documents in their template's shape
200
+
201
+ Each story-tree document the steps write takes the shape of its `qfai-sdd`
202
+ template, which is the shape the document schema checks:
203
+
204
+ | Documents | Step |
205
+ | --------------------------------------------------------------------------------------- | ---- |
206
+ | `decisions.md` and `open-questions.md` rows | 2 |
207
+ | `objective.md`, `initiative.md`, `principle.md`, `glossary.md` and `constraint.md` | 3 |
208
+ | `contracts.md` and `tech.md` | 3 |
209
+ | Markdown contracts under `cli/` | 3 |
210
+ | `business-flows.md`, `business-flow.md`, `user-stories.md` and each story's three files | 4 |
211
+ | Examples turned from test cases | 5 |
212
+
213
+ Content that does not fit that shape is listed under `## For a person`, and the
214
+ step exits 3:
215
+
216
+ - Step 3 leaves it out of the policy file, `tech.md` or CLI contract, and names the source
217
+ file and, where one fits, the template section that takes the content once a
218
+ person rewrites it. The source file is deleted, so the content is read from
219
+ git history.
220
+ - Step 3 also leaves as it is a policy file or `tech.md` that already exists
221
+ and differs from what it would write.
222
+ - A constraint row keeps only its ID, Constraint and Rationale. Step 3 lists
223
+ an Impact column, whose content belongs to the contract or `tech.md` that
224
+ owns it, and a row that names a file, a command or a rule ID, to be rewritten
225
+ in plain words.
226
+ - Step 3 numbers each constraint section from 01 in table order, and lists
227
+ every ID that changed with the ID that replaces it.
228
+ - Steps 4 and 5 write a story sentence or an example cell of another form as it
229
+ stands, for a person to rewrite.
230
+ - Step 4 lists every business flow, so that a person writes its alternate and
231
+ exception paths.
232
+
233
+ The steps do not write these into the new tree. Each stays in its old spec-pack
234
+ file, which stays in the pack while any of its content is unplaced and is then
235
+ deleted, kept in git history only:
236
+
237
+ - a spec pack's scope and source provenance;
238
+ - a story block's `Parent`, `Source` and `Flow` fields;
239
+ - a criterion's `# Parent:` line, since its directory names the story;
240
+ - a `Background:`, any scenario after a criterion's first named one, and a
241
+ `Scenario Outline:`, each listed for a person.
242
+
243
+ Step 3 writes no structure document. It routes the old `catalog/structure.md`
244
+ section by section:
245
+
246
+ | Old content | New home |
247
+ | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
248
+ | An entrypoint with a smoke or skeleton command | A `- Skeleton:` line in `tech.md`'s Standard commands |
249
+ | A layer row of an `## Architecture` or `## Architecture constraints` table of Layer, Responsibility and Depends on columns, naming no path | The `## Architecture` table of `tech.md` |
250
+ | The `ui_paths:` globs of `## UI surface paths` | `uiux.surfacePaths` in `qfai.config.yaml`, if unset |
251
+ | Anything else | `## For a person` |
252
+
253
+ Step 3 writes the moved layers in the shape of the Architecture section: a
254
+ `flowchart TD` with a node per layer and an edge per dependency, then the table
255
+ with the rows ordered from the uppermost layer down. Where the rows cannot be
256
+ ordered, because a layer depends on one that has no row or layers depend on each
257
+ other, none of them moves: the section is listed under `## For a person` with
258
+ the reason, and `tech.md` keeps the template's Architecture section.
259
+
260
+ Step 3 writes each Markdown contract under `cli/` in the shape of the CLI
261
+ contract template: its `# CLI-0001: <title>` heading, `## Ownership boundary`
262
+ and a `## Business rules` table, and nothing else.
263
+
264
+ - An old `## Ownership boundary` of one to three paragraphs that name no rule is
265
+ kept as it stands.
266
+ - Where the old contract has none, the section holds the template's placeholder,
267
+ and the contract is listed for a person to write it.
268
+ - The text before the first section, lines such as `Status:` or `Rule refs:`,
269
+ and every other section are left out. Each is listed with the old file.
270
+
271
+ Step 7 then writes the contract's rules into that table. A rule whose statement
272
+ names another rule is written and listed for a person, because a CLI contract's
273
+ rule cites only examples.
@@ -19,7 +19,7 @@ mode: execution-focused
19
19
 
20
20
  ## /qfai-prototyping
21
21
 
22
- [DRIFT-PROTOCOL:MANDATORY]
22
+ [DRIFT-PROTOCOL:REQUIRED]
23
23
 
24
24
  Run the entry check of
25
25
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -95,9 +95,10 @@ decide completion.
95
95
  The invocation completes when the user confirms the prototype and
96
96
  `prototyping-handoff` has written the handoff. A blocking finding the latest
97
97
  review still lists at that point is named in the final report. Report every
98
- decision a session adopted, as that step says. The report ends with a question
99
- listing the actions under Next, as `.agents/rules/user-questions.md` § 6 sets
100
- out. Under a no-question mode, list them in the report instead.
98
+ decision a session adopted, as that step says. Ask about the actions under Next
99
+ only when proceeding requires the user's answer, as
100
+ `.agents/rules/user-questions.md` § 6 sets out. A completion-only report needs
101
+ no question. Under a no-question mode, list any remaining actions instead.
101
102
 
102
103
  ## Next
103
104
 
@@ -10,6 +10,16 @@ every color, font, radius or shadow an iteration uses outside this file.
10
10
  A reference copy is shipped in this skill at
11
11
  `templates/DESIGN.md.sample`.
12
12
 
13
+ ## Contents
14
+
15
+ - File shape
16
+ - Front-matter schema
17
+ - `brand.archetype` allowed values
18
+ - `brand.theme`
19
+ - `accessibility` allowed keys
20
+ - Validation rules
21
+ - Issue shape
22
+
13
23
  ## File shape
14
24
 
15
25
  ```markdown
@@ -72,11 +82,10 @@ accessibility:
72
82
 
73
83
  ## `brand.archetype` allowed values
74
84
 
75
- The 8-archetype catalog is the SSOT in
76
- `.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md`:
77
- `minimal | bold | corporate | playful | organic | tech | elegant |
78
- casual`. Read that reference for archetype semantics, do not duplicate
79
- here.
85
+ The 8-archetype catalog is the SSOT in the brand catalog that
86
+ `/qfai-sdd`'s `common-design-md` step names: `minimal | bold | corporate |
87
+ playful | organic | tech | elegant | casual`. Read the catalog for
88
+ archetype semantics, do not duplicate here.
80
89
 
81
90
  ## `brand.theme`
82
91
 
@@ -5,6 +5,16 @@ Brand identity is locked by root `DESIGN.md`. Iterate on **information
5
5
  architecture**, **navigation flow**, and **usability** — not visual
6
6
  identity.
7
7
 
8
+ ## Contents
9
+
10
+ - Read order
11
+ - HTML envelope (mandatory on every iter)
12
+ - Hard constraints
13
+ - Output layout
14
+ - The first iteration (seed)
15
+ - Later iterations
16
+ - Pivot guidance (what changes vs what does not)
17
+
8
18
  ## Read order
9
19
 
10
20
  1. Root `DESIGN.md` (front-matter tokens + `# Brand Philosophy` body).
@@ -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