qfai 1.9.0 → 1.9.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 (25) hide show
  1. package/assets/init/.qfai/assistant/agents/requirements-analyst.md +6 -0
  2. package/assets/init/.qfai/assistant/manifest/agent-catalog.yml +13 -46
  3. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +21 -0
  4. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +21 -0
  5. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +22 -0
  6. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +4 -1
  7. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +21 -0
  8. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +81 -55
  9. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/evidence-requirements.md +46 -0
  10. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/generator-prompt.md +96 -6
  11. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +21 -0
  12. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/ui-contract-guide.md +61 -0
  13. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/ui-contract.sample.yaml +9 -0
  14. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +21 -0
  15. package/dist/cli/index.cjs +21118 -15483
  16. package/dist/cli/index.cjs.map +1 -1
  17. package/dist/cli/index.mjs +18057 -12413
  18. package/dist/cli/index.mjs.map +1 -1
  19. package/dist/index.cjs +2386 -659
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +44 -5
  22. package/dist/index.d.ts +44 -5
  23. package/dist/index.mjs +2369 -636
  24. package/dist/index.mjs.map +1 -1
  25. package/package.json +3 -1
@@ -33,6 +33,12 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
33
33
  - Option set with recommendation and rejected rationale
34
34
  - Open questions with owner, decision point, and safe deferral notes
35
35
  - Mapping from requirements to impacted artifacts
36
+ - For UI-bearing surfaces: every entry in the UI contract `screens[]` must
37
+ carry at least one `primary_task` (≥ 1 primary_task per screen). The
38
+ shipped `ui-contract.sample.yaml` template exposes a `primary_tasks: []`
39
+ placeholder slot; populate it before handing the contract to the
40
+ prototyping phase. Empty `primary_tasks` arrays cause the
41
+ QFAI-AUD-001 aligned validate lane to block `/qfai-prototyping`.
36
42
 
37
43
  ## Stop conditions
38
44
 
@@ -366,95 +366,62 @@ agents:
366
366
  - requirements-analyst
367
367
  - oq-harvester
368
368
  - option-explorer
369
- developer_instructions: >-
369
+ developer_instructions: |-
370
370
  ## Mission
371
371
 
372
-
373
- - Convert discussions into testable requirements, explicit open questions,
374
- and option sets with acceptance signals.
375
-
372
+ - Convert discussions into testable requirements, explicit open questions, and option sets with acceptance signals.
376
373
 
377
374
  ## Domain Responsibilities
378
375
 
379
-
380
- - Translate stakeholder intent into requirement statements and acceptance
381
- signals.
382
-
376
+ - Translate stakeholder intent into requirement statements and acceptance signals.
383
377
  - Harvest undefined decisions and maintain the OQ backlog.
384
-
385
378
  - Produce multiple solution options with a recommendation.
386
-
387
379
  - Map requirements to impacted downstream artifacts.
388
380
 
389
-
390
381
  ## Inputs you must read
391
382
 
392
-
393
383
  - .qfai/assistant/constitution/\*\*
394
-
395
384
  - .qfai/assistant/{manifest,catalog}/\*\*
396
-
397
385
  - .qfai/specs/spec-\*/09_delta.md
398
-
399
386
  - .qfai/discussion/discussion-\*/04_Sources.md
400
-
401
387
  - .qfai/discussion/discussion-\*/06_REQ.md
402
-
403
388
  - .qfai/discussion/discussion-\*/11_OQ-Register.md
404
-
405
389
  - Discussion records under `.qfai/discussion/`
406
390
 
407
-
408
391
  ## Deliverables
409
392
 
410
-
411
393
  - Requirements list with acceptance signals
412
-
413
394
  - Option set with recommendation and rejected rationale
414
-
415
395
  - Open questions with owner, decision point, and safe deferral notes
416
-
417
396
  - Mapping from requirements to impacted artifacts
418
-
397
+ - For UI-bearing surfaces: every entry in the UI contract `screens[]` must
398
+ carry at least one `primary_task` (≥ 1 primary_task per screen). The
399
+ shipped `ui-contract.sample.yaml` template exposes a `primary_tasks: []`
400
+ placeholder slot; populate it before handing the contract to the
401
+ prototyping phase. Empty `primary_tasks` arrays cause the
402
+ QFAI-AUD-001 aligned validate lane to block `/qfai-prototyping`.
419
403
 
420
404
  ## Stop conditions
421
405
 
422
-
423
- - Governing specs, routing rules, or required source artifacts are
424
- missing.
425
-
426
- - The requested output belongs to another specialist's ownership without
427
- an explicit handoff.
428
-
406
+ - Governing specs, routing rules, or required source artifacts are missing.
407
+ - The requested output belongs to another specialist's ownership without an explicit handoff.
429
408
  - The task would bypass required validation or reviewer gates.
430
409
 
431
-
432
410
  ## Sign-off
433
411
 
434
-
435
412
  - [ ] Deliverables are complete
436
-
437
413
  - [ ] Ownership boundaries were respected
438
-
439
414
  - [ ] Required gates and follow-up evidence are recorded
440
415
 
441
-
442
416
  ## When to use
443
417
 
444
-
445
418
  - Use when `agent-routing.yml` assigns this domain to the current phase.
446
-
447
419
  - Use when the task needs this specialist's owned artifacts or decisions.
448
420
 
449
-
450
421
  ## When not to use
451
422
 
452
-
453
- - Do not use when the task is primarily review-only and needs a reviewer
454
- instead.
455
-
456
- - Do not use when another specialist owns the main artifact or decision
457
- surface.
423
+ - Do not use when the task is primarily review-only and needs a reviewer instead.
424
+ - Do not use when another specialist owns the main artifact or decision surface.
458
425
  - id: solution-architect
459
426
  kind: worker
460
427
  domain: architecture
@@ -374,6 +374,27 @@ When this skill is complete, provide a final user-facing completion message and
374
374
  - Acceptance tests need fixes: rerun `/qfai-atdd`.
375
375
  Action: close uncovered `US` / `TC` / `CON-API` obligations and rerun validation.
376
376
 
377
+ ## Default Autopilot Policy
378
+
379
+ The skill collapses avoidable per-session prompts to 0-1 by classifying every decision into one of three named buckets:
380
+
381
+ - auto-decide:
382
+ - output formatting
383
+ - ID / sequence numbering
384
+ - append-vs-create on subject overlap
385
+ - equivalent-option pick
386
+ - ask-user:
387
+ - CREATE / DELETE / SPLIT / MERGE / SUPERSEDE / UPDATE:REMOVE triage operations (each with a prompt template that names the target and rationale)
388
+ - destructive operations (rm / overwrite / force-push)
389
+ - version-pin changes (`package.json#version`, branch pin)
390
+ - scope expansions outside the active envelope
391
+ - hard-required:
392
+ - `companyName`
393
+ - brand intent
394
+ - `primarySpecId` (when absent from inputs)
395
+
396
+ A skill MAY narrow the auto-decide bucket (drop entries) but MUST NOT widen it. Widening triggers a Reviewer-Gate finding.
397
+
377
398
  project_memory:
378
399
 
379
400
  - Coverage obligations stay layer-pinned: tests/e2e/** must cover all required US; tests/integration/** all required TC; tests/api/\*\* all required CON-API.
@@ -444,6 +444,27 @@ When this skill is complete, provide a final user-facing completion message and
444
444
  - Configuration needs refinement: rerun `/qfai-configure`.
445
445
  Action: provide additional include/exclude evidence and update `qfai.config.yaml`.
446
446
 
447
+ ## Default Autopilot Policy
448
+
449
+ The skill collapses avoidable per-session prompts to 0-1 by classifying every decision into one of three named buckets:
450
+
451
+ - auto-decide:
452
+ - output formatting
453
+ - ID / sequence numbering
454
+ - append-vs-create on subject overlap
455
+ - equivalent-option pick
456
+ - ask-user:
457
+ - CREATE / DELETE / SPLIT / MERGE / SUPERSEDE / UPDATE:REMOVE triage operations (each with a prompt template that names the target and rationale)
458
+ - destructive operations (rm / overwrite / force-push)
459
+ - version-pin changes (`package.json#version`, branch pin)
460
+ - scope expansions outside the active envelope
461
+ - hard-required:
462
+ - `companyName`
463
+ - brand intent
464
+ - `primarySpecId` (when absent from inputs)
465
+
466
+ A skill MAY narrow the auto-decide bucket (drop entries) but MUST NOT widen it. Widening triggers a Reviewer-Gate finding.
467
+
447
468
  project_memory:
448
469
 
449
470
  - qfai-configure is the user-facing entrypoint for editing `qfai.config.yaml` and the `.qfai/assistant/manifest/` declarative manifests; edits to those files MUST go through this skill so the agent-catalog / agent-routing / review-profiles SSOTs stay consistent.
@@ -36,6 +36,7 @@ Produce a unified 15-file discussion pack plus exploration-first UI sidecars so
36
36
  - UI-bearing discussion packs may include `prototyping.yaml` as an optional recommendation artifact; non-ui discussion packs typically omit it.
37
37
  - Completion requires `Disposition: open` count to be zero in `11_OQ-Register.md`.
38
38
  - If UI requirements exist, behavior obligations are primary and HTML+CSS mock is optional fallback only.
39
+ - When an HTML+CSS mock includes links, author them in anchor-form (`<a href="#name">`); external `http(s)://` links are also allowed. Do NOT use same-origin absolute paths (`/orders/`) — a static mock cannot serve them and the validator rejects them (QFAI-MOCK-010).
39
40
  - Discussion is planner-first: do not select a single visual winner and do not finalize the design system here.
40
41
  - Use artifact files, not conversational summaries, as the downstream handoff.
41
42
 
@@ -121,6 +122,27 @@ You MUST end the user-facing output with a handoff sentence to `/qfai-sdd` in th
121
122
  - Japanese output (use this exact sentence):
122
123
  ディスカッションが完了しました。他に要望などがあればご提示ください。問題なければ『/qfai-sdd』と入力してください。
123
124
 
125
+ ## Default Autopilot Policy
126
+
127
+ The skill collapses avoidable per-session prompts to 0-1 by classifying every decision into one of three named buckets:
128
+
129
+ - auto-decide:
130
+ - output formatting
131
+ - ID / sequence numbering
132
+ - append-vs-create on subject overlap
133
+ - equivalent-option pick
134
+ - ask-user:
135
+ - CREATE / DELETE / SPLIT / MERGE / SUPERSEDE / UPDATE:REMOVE triage operations (each with a prompt template that names the target and rationale)
136
+ - destructive operations (rm / overwrite / force-push)
137
+ - version-pin changes (`package.json#version`, branch pin)
138
+ - scope expansions outside the active envelope
139
+ - hard-required:
140
+ - `companyName`
141
+ - brand intent
142
+ - `primarySpecId` (when absent from inputs)
143
+
144
+ A skill MAY narrow the auto-decide bucket (drop entries) but MUST NOT widen it. Widening triggers a Reviewer-Gate finding.
145
+
124
146
  project_memory:
125
147
 
126
148
  - 15-file mandatory output set is fixed; the UI-bearing sidecar family (40_screen_contracts.md + 50_review_input_bundle.md + root DESIGN.md) is required only when the target is UI-bearing.
@@ -75,12 +75,15 @@ Screen-level contract details are finalized in `uiux/40_screen_contracts.md`. Pr
75
75
  <!-- Optional fallback only — do not use as the primary UI definition artifact.
76
76
  Include only when it materially clarifies the selected anchor.
77
77
  Behavior Obligations and sidecar artifacts (uiux/) are the primary UI definitions.
78
- The required state SSOT is uiux/40_screen_contracts.md (`default/loading/empty/error`). -->
78
+ The required state SSOT is uiux/40_screen_contracts.md (`default/loading/empty/error`).
79
+ Links MUST be anchor-form (`<a href="#name">`) — never same-origin absolute
80
+ paths (`/orders/`), which a static mock cannot serve and which the validator rejects. -->
79
81
 
80
82
  ```html
81
83
  <section class="screen-mock">
82
84
  <h1>Screen Title</h1>
83
85
  <p>Primary information shown to the user.</p>
86
+ <a href="#orders">View Orders</a>
84
87
  <button type="button">Primary Action</button>
85
88
  </section>
86
89
  ```
@@ -349,6 +349,27 @@ When this skill is complete, provide a final user-facing completion message and
349
349
  - Acceptance tests: `/qfai-atdd`.
350
350
  Action: ensure acceptance test coverage aligns with implementation.
351
351
 
352
+ ## Default Autopilot Policy
353
+
354
+ The skill collapses avoidable per-session prompts to 0-1 by classifying every decision into one of three named buckets:
355
+
356
+ - auto-decide:
357
+ - output formatting
358
+ - ID / sequence numbering
359
+ - append-vs-create on subject overlap
360
+ - equivalent-option pick
361
+ - ask-user:
362
+ - CREATE / DELETE / SPLIT / MERGE / SUPERSEDE / UPDATE:REMOVE triage operations (each with a prompt template that names the target and rationale)
363
+ - destructive operations (rm / overwrite / force-push)
364
+ - version-pin changes (`package.json#version`, branch pin)
365
+ - scope expansions outside the active envelope
366
+ - hard-required:
367
+ - `companyName`
368
+ - brand intent
369
+ - `primarySpecId` (when absent from inputs)
370
+
371
+ A skill MAY narrow the auto-decide bucket (drop entries) but MUST NOT widen it. Widening triggers a Reviewer-Gate finding.
372
+
352
373
  project_memory:
353
374
 
354
375
  - One TDD item at a time from test-list.md; status lifecycle is forward-only (todo → red → green → refactor → done); exception requires DR-ID.
@@ -15,14 +15,11 @@ mode: execution-focused
15
15
 
16
16
  This skill is static-first and file-based by default: it runs every
17
17
  UI-bearing spec resolved at cycle 0 through up to 10 iterations against
18
- a frozen brand SSOT (`DESIGN.md`) and a frozen spec set, with one
19
- prototype lineage per `spec × screen` pair, no parallel candidates
20
- within a pair, no mode, and a fixed 10-cycle budget. Visual identity
21
- is fixed for the whole run; every cycle improves information
22
- architecture, navigation flow, usability, and functionality. Supported
23
- UI prototyping surfaces are: web, mobile, desktop, mixed. cli is not a
24
- prototyping execution target and is rejected. ui_bearing: false specs
25
- are not prototyping execution targets and are excluded.
18
+ a frozen brand SSOT (`DESIGN.md`) and a frozen spec set, one lineage per
19
+ `spec × screen` pair, no parallel candidates, no mode, fixed 10-cycle
20
+ budget. Supported surfaces: web, mobile, desktop, mixed. cli surface is
21
+ rejected and `ui_bearing: false` specs are excluded from prototyping
22
+ execution.
26
23
 
27
24
  ## Goal
28
25
 
@@ -58,23 +55,13 @@ current `DESIGN.md` hash does not match the lock.
58
55
 
59
56
  ### Step 2-A — Verify Contract Preconditions
60
57
 
61
- - The skill resolves **every UI-bearing spec in the consumer project in
62
- one invocation** via `resolveSurfaceUnion()`
63
- (`core/prototyping/specResolution.ts`) the same resolver the
64
- cycle 1 drift gate and `show-spec`'s live scope consume, so the
65
- scope you read here is apples-to-apples with what iterate enforces
66
- downstream. `resolveSurfaceUnion()` internally composes
67
- `resolveAllUiBearingSpecs()` (the strict `surface_type: ui-bearing`
68
- frontmatter signal + the matching `.qfai/contracts/ui/<spec-id>*.yaml`
69
- contract fallback) and folds in the legacy `# … prototyping …`
70
- title-marker fallback and the operator-pinned spec id from the
71
- `qfai.config.yaml` `prototyping` section (run
72
- `qfai doctor --profile prototyping` to surface the resolved value).
73
- Operators authoring CHG-002-shaped projects can rely on the strict
74
- frontmatter alone; the broader composition covers legacy /
75
- config-pinned consumers.
76
- The operator is never prompted to pick a single spec; zero
77
- UI-bearing specs at cycle 0 is a deterministic no-op exit `0`.
58
+ - The skill resolves **every UI-bearing spec in one invocation** via
59
+ `resolveAllUiBearingSpecs()` (`core/prototyping/specResolution.ts`):
60
+ strict `surface_type: ui-bearing` frontmatter + matching
61
+ `.qfai/contracts/ui/<spec-id>*.yaml`, with legacy title-marker and
62
+ `qfai.config.yaml` `prototyping` pinning folded in. Run
63
+ `qfai doctor --profile prototyping` to surface the resolved value.
64
+ Zero UI-bearing specs at cycle 0 is a deterministic no-op exit `0`.
78
65
  Confirm each resolved spec has a supported `surface`.
79
66
  - Confirm root `DESIGN.md` and `.qfai/contracts/design/DESIGN.md.lock.yaml`
80
67
  both exist; confirm `.qfai/contracts/ui/*.yaml` exists.
@@ -85,8 +72,29 @@ current `DESIGN.md` hash does not match the lock.
85
72
  ### Step 2-B — Verify Environment Preconditions
86
73
 
87
74
  - Confirm a capture route exists for each declared screen.
88
- - Use `npx --no-install playwright-cli` or
89
- `node_modules/.bin/playwright-cli` when PATH reachability is uncertain.
75
+ - Canonical launcher: `npx --no-install playwright` or
76
+ `node_modules/.bin/playwright` when PATH reachability is uncertain.
77
+ - Legacy fallback (deprecation window only, emits
78
+ `D-DEPRECATED-PROBE` and will be removed in a future minor release):
79
+ `npx --no-install playwright-cli` or `node_modules/.bin/playwright-cli`.
80
+
81
+ ### Step 2-B.1 — Opt-in iterate flags
82
+
83
+ Three flags extend `qfai prototyping iterate`; all default OFF so the
84
+ prior invocation pattern is byte-equivalent when no flag is passed:
85
+
86
+ - `--capture` — enable PNG / HTML capture per screen each cycle via
87
+ the default Playwright runner (dynamic `import("playwright")`;
88
+ Playwright is `optionalDependencies`). Use for durable pixel / DOM
89
+ evidence; skip for fast prose-only cycles.
90
+ - `--auto-serve` — start an in-process `node:http` server rooted at
91
+ the prototype tree for the cycle. SIGINT teardown <= 2 s;
92
+ EADDRINUSE on a foreign owner exits 2 (no foreign-process kill).
93
+ Use when no external dev server is running.
94
+ - `--check-convergence` — read-only peek of `prototyping.json`.
95
+ Exits `0` when converged (`stopReason === "axes-exceptional"` with
96
+ `acceptedIterationIndex` set), exits `2` otherwise. No writes,
97
+ no Playwright launches. Use at cycle 9 before recovery.
90
98
 
91
99
  ### Step 2-C — Run the Loop
92
100
 
@@ -113,41 +121,38 @@ covers `frozenSurfaceUnion` / `frozenLicenseCatalog` drift on cycle ≥ 1).
113
121
  `prototyping.json` violates the cycle-0 frozen license catalog. The
114
122
  verifier rejects five distinct error codes:
115
123
 
116
- - `license-not-allowlisted` — `source` is not in
117
- `frozenLicenseCatalog.allowedSources`
118
- - `license-tier-unknown` — `license` is not in
119
- `frozenLicenseCatalog.licenseTiers[source]`
124
+ - `license-not-allowlisted` — `source` not in `allowedSources`
125
+ - `license-tier-unknown` — `license` not in `licenseTiers[source]`
120
126
  - `license-non-https-url` — `url` is not HTTPS
121
- - `license-host-mismatch` — the URL host is not in
122
- `frozenLicenseCatalog.sourceHosts[source]`
123
- - `license-missing-attribution` — `attribution` is undefined / empty /
124
- whitespace-only
127
+ - `license-host-mismatch` — URL host not in `sourceHosts[source]`
128
+ - `license-missing-attribution` — `attribution` empty / whitespace
125
129
 
126
130
  Recovery path (no in-loop retry — the verifier is fail-closed):
127
131
 
128
- 1. Inspect `prototyping.json#frozenLicenseCatalog` to see the frozen
132
+ 1. Inspect `prototyping.json#frozenLicenseCatalog` for the frozen
129
133
  `allowedSources` / `licenseTiers` / `sourceHosts`.
130
134
  2. Edit the offending `imageSources[]` entry to use an allowlisted
131
- source / known license tier / HTTPS URL / matching host / non-empty
132
- attribution. **Do not** edit `frozenLicenseCatalog` mid-loop — that
133
- triggers a separate exit-2 lock-drift class.
134
- 3. If the legitimate fix requires a different allowlist (e.g. adding a
135
- new source), the only path is to refreeze the catalog by restarting
136
- from cycle 0 (`qfai prototyping iterate --cycle 0 --target-url <url>`)
137
- with the updated stock-photo configuration.
135
+ source / known tier / HTTPS URL / matching host / non-empty
136
+ attribution. **Do not** edit `frozenLicenseCatalog` mid-loop
137
+ (separate exit-2 lock-drift class).
138
+ 3. To change the allowlist, refreeze the catalog by restarting from
139
+ cycle 0 with the updated stock-photo configuration.
138
140
 
139
141
  ### Cycle 9 budget exhaustion
140
142
 
141
- If convergence is not reached at iter-09, the certify gate will reject
142
- the run H handoff artifacts (final mirror, `design-system.yaml`,
143
- `prototype-handoff.yaml`) and the `validate` / `/qfai-verify` gates can
144
- still be written / executed for inspection, but
145
- `qfai prototyping certify --check` will exit non-zero and prevent DONE.
146
- The recovery path is to restart from cycle 0: review `DESIGN.md`, the
147
- pivot strategy in `references/reviewer-prompt.md`, and the latest
148
- `review.json` findings, then re-run `qfai prototyping iterate
149
- --cycle 0 --target-url <url>` to refreeze the loop. Do not seal a
150
- completion certificate against an unconverged iter-09.
143
+ If convergence is not reached at iter-09, certify rejects the run; H
144
+ handoff artifacts and `validate` / `/qfai-verify` can still execute for
145
+ inspection, but `qfai prototyping certify --check` will exit non-zero
146
+ and prevent DONE.
147
+
148
+ Use `qfai prototyping iterate --cycle 9 --check-convergence` for a
149
+ read-only peek of `prototyping.json` before refreezing: exit `0`
150
+ confirms convergence (no recovery needed), exit `2` confirms the run
151
+ did not converge. Recovery: review `DESIGN.md`, the pivot strategy
152
+ in `references/reviewer-prompt.md`, and the latest `review.json`
153
+ findings, then re-run `qfai prototyping iterate --cycle 0
154
+ --target-url <url>` to refreeze. Do not seal a certificate against
155
+ an unconverged iter-09.
151
156
 
152
157
  ## Evaluator Inputs (Mandatory)
153
158
 
@@ -163,8 +168,8 @@ completion certificate against an unconverged iter-09.
163
168
  latest iter is always accepted.
164
169
  - `DESIGN.md` is frozen for the run; to change it, edit + rerun
165
170
  `/qfai-sdd` to refreeze + start cycle 0.
166
- - Token-only colors / fonts / radii / shadows — non-DESIGN.md hex / rgb /
167
- rgba / hsl / font / radius / shadow values are recorded in
171
+ - Token-only colors / fonts / radii / shadows — non-DESIGN.md hex /
172
+ rgb / rgba / hsl / font / radius / shadow values land in
168
173
  `designMdViolations[]` and block exit 64.
169
174
  - DONE only when `qfai prototyping certify --check` returns 0.
170
175
  - No `mode / round / polish / branch / concept-fit` artifacts.
@@ -196,6 +201,27 @@ Follow `.qfai/assistant/constitution/shared-skill-operating-baseline.md#gate-fai
196
201
 
197
202
  - `/qfai-atdd` / `/qfai-implement` / `/qfai-verify`
198
203
 
204
+ ## Default Autopilot Policy
205
+
206
+ The skill collapses avoidable per-session prompts to 0-1 by classifying every decision into one of three named buckets:
207
+
208
+ - auto-decide:
209
+ - output formatting
210
+ - ID / sequence numbering
211
+ - append-vs-create on subject overlap
212
+ - equivalent-option pick
213
+ - ask-user:
214
+ - CREATE / DELETE / SPLIT / MERGE / SUPERSEDE / UPDATE:REMOVE triage operations (each with a prompt template that names the target and rationale)
215
+ - destructive operations (rm / overwrite / force-push)
216
+ - version-pin changes (`package.json#version`, branch pin)
217
+ - scope expansions outside the active envelope
218
+ - hard-required:
219
+ - `companyName`
220
+ - brand intent
221
+ - `primarySpecId` (when absent from inputs)
222
+
223
+ A skill MAY narrow the auto-decide bucket (drop entries) but MUST NOT widen it. Widening triggers a Reviewer-Gate finding.
224
+
199
225
  project_memory:
200
226
 
201
227
  - Iteration count cap is 10; --cycle is 0-indexed; reaching cycle 9 on a non-converged iteration set exits 65 directly (no cycle-mismatch path).
@@ -0,0 +1,46 @@
1
+ # Evidence Requirements: `taskFidelity` section
2
+
3
+ Prototyping evidence files MUST include a `taskFidelity` section so the
4
+ `QFAI-CRIT-009` gate passes. Below is the required keyword set and
5
+ the canonical markdown shape consumed by the validator and the
6
+ `qfai prototyping iterate --capture` template emitter.
7
+
8
+ ## Required keywords
9
+
10
+ Every evidence file that records a critique iteration MUST surface
11
+ these `taskFidelity` keys with concrete values:
12
+
13
+ - `cta_visibility` — does the primary call-to-action stay on-screen and
14
+ visually distinct at both desktop (>= 1024px) and mobile (<= 480px)
15
+ viewports?
16
+ - `four_state_check` — has the interactive flow been checked in all
17
+ four reachable states (default / hover / focused / disabled), with a
18
+ pass/fail observation per state?
19
+
20
+ The SSOT for this list lives at
21
+ `packages/qfai/src/core/validators/taskFidelityKeywords.ts`
22
+ (`TASK_FIDELITY_REQUIRED_KEYWORDS`). The validator (`QFAI-CRIT-009`),
23
+ the `--capture` template emitter, and this document all read from
24
+ that constant so the keyword set cannot silently drift between the
25
+ three surfaces.
26
+
27
+ ## Canonical markdown structure
28
+
29
+ The validator detects the section via the literal heading
30
+ `## taskFidelity`. The minimal accepted shape is:
31
+
32
+ ```markdown
33
+ ## taskFidelity
34
+
35
+ - step_count: 3
36
+ - max_primary_steps: 5
37
+ - cta_visibility: PASS — primary CTA stays anchored at the viewport bottom on
38
+ desktop (1440px) and remains tappable on mobile (375px).
39
+ - four_state_check: PASS — default / hover / focused / disabled states each
40
+ render the expected variant; disabled is non-interactive.
41
+ ```
42
+
43
+ Authors may add free-form prose between the bullets so long as each
44
+ required keyword appears at least once. The `--capture` template emits
45
+ a stub with TODO placeholders for every required keyword so the
46
+ operator never silently forgets one.
@@ -50,12 +50,102 @@ tokens (e.g. `bg-primary`, `text-text`, `rounded-md`, `shadow-lg`,
50
50
 
51
51
  ## Hard constraints (enforced by the compliance gate)
52
52
 
53
- - No `#hex`, `rgb(...)`, `rgba(...)`, `hsl(...)`, `hsla(...)` value
54
- outside `DESIGN.md.visual.colors`.
55
- - No `font-family:` whose first token is outside
56
- `DESIGN.md.visual.typography.family_*`.
57
- - No `border-radius:` outside `DESIGN.md.visual.radius`.
58
- - No `box-shadow:` outside `DESIGN.md.visual.shadow`.
53
+ The compliance gate scans rendered HTML `<style>` blocks, inline
54
+ `style="..."` attributes, AND Tailwind `class="..."` attributes — for
55
+ four categories of forbidden literals. Findings are **advisory-failing**:
56
+ the gate blocks convergence by default, but a Reviewer can override
57
+ when a finding is a known false positive.
58
+
59
+ ### 1. color literal ban
60
+
61
+ No raw color literals outside `DESIGN.md.visual.colors`. The scanner
62
+ catches every authoring path:
63
+
64
+ - `#hex` (3 / 4 / 6 / 8 nibbles): e.g. `color: #ff0000`,
65
+ `bg-[#ff0000]`.
66
+ - `rgb(...)` / `rgba(...)`: e.g. `background: rgb(255 0 0)`,
67
+ `bg-[rgb(255_0_0)]`.
68
+ - `hsl(...)` / `hsla(...)`: e.g. `color: hsl(0 100% 50%)`.
69
+ - CSS named-color keywords (`red`, `white`, `blue`, …) when placed
70
+ on a color-bearing property (`color`, `background`, `border`,
71
+ `outline`, `fill`, `stroke`, `caret-color`, `text-decoration`,
72
+ `column-rule`, and their `-color` longhands / shorthand variants).
73
+ - Tailwind palette utilities (`bg-blue-500`, `text-slate-900`,
74
+ `border-red-400`, etc.) — the CDN cannot read `DESIGN.md`, so
75
+ every palette class is by definition drift.
76
+
77
+ ### 2. font-family literal ban
78
+
79
+ No `font-family:` whose first family token is outside
80
+ `DESIGN.md.visual.typography.family_sans` / `family_display` /
81
+ `family_mono`. Authored forms caught:
82
+
83
+ - Inline `font-family: Inter, sans-serif` (quoted or unquoted).
84
+ - Tailwind arbitrary `font-[Inter]`. Numeric / named font-weight
85
+ arbitraries (`font-[600]`, `font-[medium]`) are weight tokens —
86
+ not font-family drift — and pass through.
87
+
88
+ ### 3. border-radius literal ban
89
+
90
+ No `border-radius:` value outside `DESIGN.md.visual.radius`. Authored
91
+ forms caught:
92
+
93
+ - Inline `border-radius: 12px` / `border-radius: 0.5rem`.
94
+ - Tailwind arbitrary `rounded-[13px]`, `rounded-[0.5rem]`.
95
+ - Tailwind scale aliases (`rounded`, `rounded-sm`, `rounded-md`,
96
+ `rounded-lg`, `rounded-xl`, `rounded-2xl`, `rounded-3xl`,
97
+ `rounded-full`, `rounded-none`) — all resolve to Tailwind defaults,
98
+ not `DESIGN.md` tokens.
99
+
100
+ ### 4. box-shadow literal ban (including rgba color slot)
101
+
102
+ No `box-shadow:` declaration outside `DESIGN.md.visual.shadow`. The
103
+ shadow value's embedded `rgba(...)` color slot is also covered.
104
+ Authored forms caught:
105
+
106
+ - Inline `box-shadow: 0 1px 2px rgba(15,23,42,0.05)`.
107
+ - Tailwind arbitrary `shadow-[0_4px_6px_rgba(0,0,0,0.1)]`.
108
+ - Tailwind scale aliases (`shadow`, `shadow-sm`, `shadow-md`,
109
+ `shadow-lg`, `shadow-xl`, `shadow-2xl`, `shadow-inner`,
110
+ `shadow-none`, `drop-shadow-*`).
111
+
112
+ ### Safelisted CSS-wide keywords
113
+
114
+ The following values are **not** treated as drift by any of the four
115
+ scanners above — they are CSS inheritance / system keywords with no
116
+ visual identity:
117
+
118
+ - `inherit`
119
+ - `initial`
120
+ - `unset`
121
+ - `revert`
122
+ - `currentColor` (case-insensitive)
123
+ - `transparent`
124
+ - `none`
125
+ - `0` (dimensionless)
126
+
127
+ Authoring `font-family: inherit`, `border-radius: 0`, or
128
+ `box-shadow: none` passes the gate even when not present in
129
+ `DESIGN.md`.
130
+
131
+ ### Allowed expression forms
132
+
133
+ The generator MUST express every styled surface as one of:
134
+
135
+ - A Tailwind utility class whose token resolves through the
136
+ `tailwind.config.theme.extend.*` injection above (e.g. `bg-primary`,
137
+ `text-text`, `rounded-md`, `shadow-lg`, `font-display`). These
138
+ utilities reference `DESIGN.md` tokens by name and never carry a
139
+ literal in the rendered DOM.
140
+ - A CSS custom-property reference via `var(--token-name)` where the
141
+ `--token-name` is declared in a `:root { ... }` block inside the
142
+ iter's `<style>` head. The scanner resolves the `var()` against
143
+ the `:root` map and re-validates the resolved value against
144
+ `DESIGN.md`.
145
+ - A `theme(...)` reference to the injected Tailwind theme.
146
+
147
+ ### Other envelope constraints
148
+
59
149
  - No component library beyond Tailwind + Lucide. No external CSS, no
60
150
  design-system imports.
61
151
  - One self-contained HTML file; embedded CSS / JS minimal.
@@ -272,6 +272,27 @@ When this skill completes, provide a final user-facing message enumerating next
272
272
  - Spec pack needs correction: rerun `/qfai-sdd` and regenerate evidence.
273
273
  - Confirm contracts referenced by `_policies/05_Contracts.md` exist under `.qfai/contracts/**`.
274
274
 
275
+ ## Default Autopilot Policy
276
+
277
+ The skill collapses avoidable per-session prompts to 0-1 by classifying every decision into one of three named buckets:
278
+
279
+ - auto-decide:
280
+ - output formatting
281
+ - ID / sequence numbering
282
+ - append-vs-create on subject overlap
283
+ - equivalent-option pick
284
+ - ask-user:
285
+ - CREATE / DELETE / SPLIT / MERGE / SUPERSEDE / UPDATE:REMOVE triage operations (each with a prompt template that names the target and rationale)
286
+ - destructive operations (rm / overwrite / force-push)
287
+ - version-pin changes (`package.json#version`, branch pin)
288
+ - scope expansions outside the active envelope
289
+ - hard-required:
290
+ - `companyName`
291
+ - brand intent
292
+ - `primarySpecId` (when absent from inputs)
293
+
294
+ A skill MAY narrow the auto-decide bucket (drop entries) but MUST NOT widen it. Widening triggers a Reviewer-Gate finding.
295
+
275
296
  project_memory:
276
297
 
277
298
  - Phase order is fixed: Stage 0 Preflight → Stage 1 Triage → Phase 0 Contracts-first → Phase 1 Outline → Phase 2 Slice → Phase 3 Plan finalize → Phase 4 Delta update; do not reorder.