qfai 1.7.13 → 1.7.15

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 (74) hide show
  1. package/README.md +35 -8
  2. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +2 -2
  3. package/assets/init/.qfai/assistant/agents/product-experience-architect.md +2 -2
  4. package/assets/init/.qfai/assistant/agents/product-surface-reviewer.md +1 -1
  5. package/assets/init/.qfai/assistant/instructions/agent-selection.md +2 -0
  6. package/assets/init/.qfai/assistant/instructions/shared-skill-delegation-baseline.md +88 -0
  7. package/assets/init/.qfai/assistant/instructions/shared-skill-operating-baseline.md +49 -0
  8. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +28 -88
  9. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +50 -114
  10. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +137 -208
  11. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-md-brand-catalog.md +90 -0
  12. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-completion-matrix.md +26 -0
  13. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-coverage-checklist.md +20 -0
  14. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/example-mapping-guide.md +18 -0
  15. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/oq-and-deferred-rules.md +41 -0
  16. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/review-cycle-playbook.md +22 -0
  17. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +50 -0
  18. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/platform_baselines.md +107 -0
  19. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/review_audit_playbook.md +104 -0
  20. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/trend_scan_playbook.md +76 -0
  21. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux_best_practices.md +143 -1005
  22. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +9 -0
  23. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +1 -1
  24. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/04_Sources.md +83 -32
  25. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +7 -7
  26. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/prototyping.yaml +12 -4
  27. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +2 -2
  28. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +2 -2
  29. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/10_implementation_strategy.md +31 -13
  30. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/12_design_system.md +115 -0
  31. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/21_design_eval_trend_derived.md +86 -24
  32. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/23_design_eval_aggregate.md +12 -0
  33. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +1 -1
  34. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +2 -0
  35. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +27 -27
  36. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +145 -155
  37. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +118 -355
  38. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/review-cycle-playbook.md +30 -0
  39. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-execution-playbook.md +29 -0
  40. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-phase-checklists.md +37 -0
  41. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-quality-gate.md +32 -0
  42. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/spec-traceability-rules.md +33 -0
  43. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +50 -115
  44. package/assets/init/.qfai/assistant/steering/agent-catalog.yml +1 -1
  45. package/assets/init/.qfai/assistant/steering/agent-routing.yml +20 -8
  46. package/assets/init/.qfai/assistant/steering/manifest.md +4 -7
  47. package/assets/init/.qfai/assistant/steering/product.md +6 -6
  48. package/assets/init/.qfai/assistant/steering/review-profiles.yml +3 -0
  49. package/assets/init/.qfai/assistant/steering/ui-definition-protocol.md +7 -7
  50. package/assets/init/.qfai/contracts/README.md +15 -8
  51. package/assets/init/.qfai/contracts/ui/README.md +24 -26
  52. package/assets/init/.qfai/discussion/README.md +35 -32
  53. package/assets/init/.qfai/evidence/README.md +65 -181
  54. package/assets/init/.qfai/evidence/calibration.yaml +26 -0
  55. package/assets/init/.qfai/review/README.md +56 -11
  56. package/assets/init/.qfai/specs/README.md +2 -2
  57. package/assets/init/root/qfai.config.yaml +5 -6
  58. package/assets/scripts/capture-screenshots.js +128 -0
  59. package/assets/uix-rev/comparison-review.md +3 -15
  60. package/assets/uix-rev/contracts-review.md +5 -2
  61. package/assets/uix-rev/scoring-review.md +10 -2
  62. package/assets/uix-rev/strategy-review.md +11 -7
  63. package/dist/cli/index.cjs +8532 -4204
  64. package/dist/cli/index.cjs.map +1 -1
  65. package/dist/cli/index.mjs +8599 -4271
  66. package/dist/cli/index.mjs.map +1 -1
  67. package/dist/index.cjs +9808 -5532
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.d.cts +467 -277
  70. package/dist/index.d.ts +467 -277
  71. package/dist/index.mjs +8909 -4647
  72. package/dist/index.mjs.map +1 -1
  73. package/package.json +1 -1
  74. package/assets/uix-rev/migration-review.md +0 -17
package/README.md CHANGED
@@ -17,8 +17,12 @@ The agent reads the repository, produces the required artifacts, and iterates un
17
17
 
18
18
  ## Release status
19
19
 
20
- - Current package version: `1.7.13`
21
- - Release posture: v1.7.13 converges init assets, validators, and docs on the canonical sidecar model.
20
+ - Current package version: `1.7.15`
21
+ - Release posture: v1.7.15 enforces runtime truthfulness.
22
+ - Prototyping is UI-only; `full-harness` is measurement-driven iteration accumulation for UI-bearing surfaces only.
23
+ - Runtime observation is observed-only (no synthetic 200 / API / DB prototyping coverage).
24
+ - Browser QA is mandatory per screen in full-harness, and `actionsWired` reports action coverage rather than finding count.
25
+ - Calibration SSOT is the calibration pack referenced by `calibrationRef.packPath`.
22
26
  - Current repo note: some repo-wide `qfai validate --fail-on error` blockers still come from historical review/evidence/ATDD/TDD artifacts and are being cleaned incrementally.
23
27
 
24
28
  ## Quick start
@@ -54,8 +58,27 @@ npx qfai report
54
58
  - `npx qfai doctor`
55
59
  - Diagnoses configuration discovery, path resolution, glob scanning, and `validate.json` inputs before running validate/report; use `--fail-on` to enforce failures in CI.
56
60
  Note: prototyping evidence (`.qfai/evidence/prototyping.json`) is produced by the AI workflow / skills
57
- (`/qfai-prototyping` with `mode=low-cost|standard|full-harness`), not by a CLI command.
61
+ (`/qfai-prototyping` with `mode=full-harness` for supported UI surfaces only), not by a general-purpose end-user CLI flow.
58
62
  `qfai validate` consumes the resulting evidence files, including `mode.effective` and `fullHarness` metadata when present.
63
+ Traceability refs inside prototyping evidence must use repo-root-relative concrete artifact refs (for example `.qfai/specs/spec-0001/01_Spec.md#L3` or `.qfai/evidence/render.json#/screens/0`).
64
+ Absolute paths are invalid. The same strict ref grammar is enforced for top-level and leaf evidence-bearing fields, including
65
+ `runtimeGate.evidenceRefs`, `runtimeGate.ui[].declaredRef`, `runtimeGate.ui[].renderEvidenceRefs[]`,
66
+ `runtimeGate.ui[].browserQaEvidenceRefs[]`, `specs[].coverageRefs[].declaredRef`, `specs[].coverageRefs[].observedRefs[]`,
67
+ `fullHarness.iterations[].evidenceRefs.runtimeGate`, `fullHarness.iterations[].evidenceRefs.specCoverage`,
68
+ `fullHarness.iterations[].evidenceRefs.render`, `fullHarness.iterations[].evidenceRefs.browserQa`,
69
+ `fullHarness.iterations[].evidenceRefs.uiObservation`, `fullHarness.iterations[].evidenceRefs.discussion`,
70
+ `fullHarness.iterations[].evidenceRefs.screenContract`, `fullHarness.iterations[].evidenceRefs.trend`,
71
+ `fullHarness.iterations[].l1.axes[].evidenceRefs[]`, `fullHarness.iterations[].l2.axes[].evidenceRefs[]`, and
72
+ `fullHarness.reviewerLogs[].evidenceRefs[]`.
73
+ Semantic rules are also strict: `runtimeGate.ui[].declaredRef` and `fullHarness.iterations[].evidenceRefs.screenContract[]`
74
+ must use the canonical screen contract sourceRef `.qfai/discussion/<pack>/uiux/40_screen_contracts.md#<screenId>`,
75
+ and `specs[].coverageRefs[].declaredRef` must use the canonical spec declaration form
76
+ `.qfai/specs/<specId>/01_Spec.md#L<line>` (for example `.qfai/specs/spec-0001/01_Spec.md#L3`);
77
+ `notes.md`, `appendix.md`, anchor-fragment forms such as `#route-home`, discussion refs, and screen contract refs
78
+ are NOT valid `declaredRef` values.
79
+ `fullHarness` follows a terminal-first state machine: `status="in-progress"` requires `finalDecision="pending"`,
80
+ `reviewerSignoff.status="pending"`, and no `terminationReason`; `status="completed"` requires `terminationReason`,
81
+ a non-pending `finalDecision`, and a terminal `reviewerSignoff`.
59
82
 
60
83
  ## ATDD annotation hard gate
61
84
 
@@ -85,9 +108,11 @@ QFAI includes a small set of custom skills (stored under `.qfai/assistant/skills
85
108
  - **qfai-configure**: Analyze the repository (language, frameworks, test layout, directory structure)
86
109
  and tailor `qfai.config.yaml` accordingly (especially `testFileGlobs`).
87
110
  Run this once right after `npx qfai init`, and re-run it when the repository structure changes.
88
- - **qfai-discussion**: Run a unified structured discussion that produces and maintains the latest discussion pack as 15 required markdown files plus required prototyping.yaml under `.qfai/discussion/discussion-<ts>/`.
111
+ - **qfai-discussion**: Run a unified structured discussion that produces and maintains the latest discussion pack
112
+ as 15 required markdown files under `.qfai/discussion/discussion-<ts>/`.
113
+ UI-bearing discussion packs require `prototyping.yaml`; non-ui discussion packs do not.
89
114
  - **qfai-sdd**: Unified SDD entrypoint with discussion-pack preflight guard (missing/incomplete/blocking OQ causes stop + next action guidance).
90
- - **qfai-prototyping**: Build a contract-aligned implementation skeleton with static-first evidence by default, and escalate to full-harness only when explicitly justified.
115
+ - **qfai-prototyping**: Build a contract-aligned UI prototype under the `full-harness` only / UI-only contract, with calibration-pack SSOT and screen-level Browser QA evidence.
91
116
  - **qfai-atdd**: Implement acceptance tests driven by specs/scenarios.
92
117
  - **qfai-implement**: Unified TDD micro-cycle (Red/Green/Refactor) one test at a time using `test-list.md` as the execution ledger, including ledger status updates and exception closure.
93
118
  - **qfai-verify**: Run full-scan local quality gates (`validate --fail-on error`, `report`, repo gates) and produce reviewer-approved evidence under `.qfai/evidence/`.
@@ -189,8 +214,10 @@ Notes.
189
214
 
190
215
  - `validate.json`, `report.json`, `doctor.json`, and `run-*` JSON logs are internal exports and are not a stable external contract; prefer `report.md` for integrations that must survive tool upgrades.
191
216
  - Scenario files are expected to use the Gherkin extension `*.feature` (not `*.md`).
192
- - `prototyping.calibration` in `qfai.config.yaml` connects full-harness scoring thresholds to the report and validator.
193
- - Observability modules (`src/core/observability/`) exist as foundation code but are **not integrated into blocking validation** in v1.7.13. They are reserved for future operational instrumentation.
217
+ - `prototyping.calibration.packPath` points to the calibration pack SSOT; runtime and validator both resolve thresholds and iteration parameters from that pack.
218
+ - `prototyping.calibration.thresholds`, `maxIterations`, `plateauDelta`, and `plateauLookback` are unsupported public config fields in v1.7.15.
219
+ Put calibration values in the referenced pack instead of `qfai.config.yaml`.
220
+ - Observability modules (`src/core/observability/`) exist as foundation code but are **not integrated into blocking validation** in v1.7.14. They are reserved for future operational instrumentation.
194
221
 
195
222
  ## Specifications and contracts (SDD)
196
223
 
@@ -266,7 +293,7 @@ Recommended baseline.
266
293
 
267
294
  Waiver policy.
268
295
 
269
- - Use waivers only for `warning` / `info` findings (false positives, phased migration noise).
296
+ - Use waivers only for `warning` / `info` findings (false positives).
270
297
  - Waivers that target `error` findings are invalid and fail validation (`QFAI-WAIVER-002`).
271
298
  - Expired waivers are reported as warnings (`QFAI-WAIVER-003`) and must be renewed or removed with evidence.
272
299
  - Suppressed findings remain visible in reports as `suppressed=true`; waivers do not erase findings.
@@ -2,12 +2,12 @@
2
2
 
3
3
  ## Mission
4
4
 
5
- - Implement frontend behavior aligned with selected direction, strategy, screen contracts, and product experience decisions.
5
+ - Implement frontend behavior aligned with selected anchor, strategy, screen contracts, and product experience decisions.
6
6
 
7
7
  ## Domain Responsibilities
8
8
 
9
9
  - Build UI components, states, interactions, and user-facing flows.
10
- - Respect selected direction, strategy, screen contracts, optional design tokens, optional fallback HTML/CSS mock, and screen flow constraints.
10
+ - Respect selected anchor, strategy, screen contracts, optional design tokens, optional fallback HTML/CSS mock, and screen flow constraints.
11
11
  - Coordinate with backend changes without breaking surface contracts.
12
12
  - Implement with KISS and YAGNI: prefer the simplest component/state structure that satisfies the current contract, and do not add speculative hooks, props, flags, or abstraction layers.
13
13
  - Keep UI code cohesive and readable: isolate concerns, minimize hidden coupling, avoid duplication, and use existing patterns/utilities before inventing new ones.
@@ -9,7 +9,7 @@
9
9
  - Define UX direction, user journeys, interaction patterns, and accessibility expectations.
10
10
  - Define visual design direction, tokens, typography, color, and layout hierarchy.
11
11
  - Design navigation structures, IA, and screen transition logic.
12
- - Integrate selected direction, strategy, screen contracts, evaluation sidecars, and Mermaid flow consistency.
12
+ - Integrate selected anchor, strategy, screen contracts, evaluation sidecars, and Mermaid flow consistency.
13
13
  - Resolve conflicts between specialist design perspectives as a unified product experience decision.
14
14
  - Apply KISS and YAGNI to product-surface design: only add screens, controls, states, and branching flows that are justified by the current user goal.
15
15
  - Keep product experience decisions cohesive and unsurprising across copy, IA, navigation, transitions, and visual hierarchy.
@@ -24,7 +24,7 @@
24
24
  - .github/instructions/principles.instructions.md
25
25
  - .instruction/00_universal/development-principles-checklist.md
26
26
  - .instruction/01_specialties/design.md
27
- - Selected direction, strategy, screen contracts, evaluation sidecars, optional tokens, optional fallback HTML/CSS mock, and Mermaid flows
27
+ - Selected anchor, strategy, screen contracts, evaluation sidecars, optional tokens, optional fallback HTML/CSS mock, and Mermaid flows
28
28
  - Runtime screenshots or rendered evidence when available
29
29
 
30
30
  ## Deliverables
@@ -9,7 +9,7 @@
9
9
  - Audit frontend changes for correctness and user-facing risk.
10
10
  - Audit layout sanity, interaction usability, and accessibility guardrails.
11
11
  - Audit visual design, token alignment, and service-level UX coherence.
12
- - Reconcile sidecar artifacts (selected direction, strategy, screen contracts), design tokens, mermaid flows, and rendered output consistency.
12
+ - Reconcile sidecar artifacts (selected anchor, strategy, screen contracts), design tokens, mermaid flows, and rendered output consistency.
13
13
  HTML mock is optional fallback evidence only. Design tokens are supporting input.
14
14
  - Review UI changes for KISS and YAGNI at the surface layer: avoid needless states, controls, flows, animations, and configuration that are not justified by the product goal.
15
15
  - Check naming, structure, and responsibility split of UI components for clarity, cohesion, and minimal surprise.
@@ -7,6 +7,8 @@ dependencies:
7
7
  version: 2.0.0
8
8
  ---
9
9
 
10
+ <!-- markdownlint-disable MD041 -->
11
+
10
12
  > **言語指示(厳守)**
11
13
  >
12
14
  > - 報告・出力: 日本語(Plan も含む)
@@ -0,0 +1,88 @@
1
+ # Shared Skill Delegation Baseline
2
+
3
+ Use this document to keep SKILL bodies compact.
4
+ Skill files should reference this baseline and only add role-, stage-, or gate-specific rules.
5
+
6
+ ## Sub-agent Delegation (MANDATORY)
7
+
8
+ ### Orchestrator Protocol (MUST)
9
+
10
+ - The orchestrator may create work orders, delegate tasks, integrate outputs, and present results.
11
+ - The orchestrator must not generate the primary artifact first draft.
12
+ - The orchestrator must not self-approve or act as reviewer for convenience.
13
+
14
+ ### Capability Probe (MUST)
15
+
16
+ 1. Attempt the first required delegation at stage start using the platform's native delegation mechanism.
17
+ 2. Treat that first real delegation attempt as the capability check. Do not gate execution on preflight availability questions or synthetic probe-only checks.
18
+ 3. If the delegation fails, stop the stage immediately. Do not simulate roles and do not continue with self-execution.
19
+
20
+ ### Delegation Failure (Hard Stop)
21
+
22
+ - Report all of:
23
+ - `Delegation failure: <raw reason or concise summary>`
24
+ - `Attempted role: <role>`
25
+ - `Attempted task: <task title>`
26
+ - `Why stopped: QFAI requires real sub-agent delegation in this environment.`
27
+ - `User action needed: <settings or tooling changes required>`
28
+ - `Retry condition: rerun after the required delegation succeeds`
29
+
30
+ ## Work Orders Summary
31
+
32
+ Every major artifact in the stage should include this table schema:
33
+
34
+ | Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
35
+ | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
36
+ | 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
37
+
38
+ - `Output (refs)` should point to in-file anchors or relative evidence paths.
39
+
40
+ ## Reviewer Gate Baseline
41
+
42
+ - Final completion gate must be delegated to an independent reviewer.
43
+ - Reviewers must verify Drift Protocol enforcement.
44
+ - Reviewers must verify test-layer policy enforcement when relevant.
45
+ - Do not treat test volume ratios or floors as hard gates unless the skill explicitly says so.
46
+ - Do not declare DONE until all routed blocking reviewers return `PASS`.
47
+ - Every reviewer returning `FAIL` or `REVISE` must include a concrete fix proposal.
48
+
49
+ ## Work order template
50
+
51
+ ```text
52
+ Task title: <short>
53
+ Role: <sub-agent role>
54
+ Goal: <what to decide/produce>
55
+ Inputs (refs):
56
+ - <file/section>
57
+ Constraints:
58
+ - must: enforce Drift Protocol
59
+ - must: follow applicable test-layer or validation policy
60
+ - must_not: patch upstream artifacts directly when owner rerun is required
61
+ Output format:
62
+ - <headings / bullet schema>
63
+ Quality bar:
64
+ - PASS if ...
65
+ - REVISE if ...
66
+ ```
67
+
68
+ ## Reviewer response template
69
+
70
+ ```text
71
+ Result: PASS | REVISE
72
+ Findings:
73
+ - <issue>
74
+ Required fixes:
75
+ - <action>
76
+ Evidence checked:
77
+ - <refs>
78
+ ```
79
+
80
+ ### Verdict vocabulary
81
+
82
+ - Reviewer responses in-flight use `Result: PASS | REVISE` (this file).
83
+ - `summary.json` archived into review packs historically uses
84
+ `status: "PASS|FAIL"` (validated by
85
+ `packages/qfai/src/core/validators/reviewArtifacts.ts`).
86
+ - A `REVISE` verdict during iteration maps to `status: "FAIL"` when the
87
+ final `summary.json` is written; they represent the same outcome.
88
+ Review packs should not invent a third verdict.
@@ -0,0 +1,49 @@
1
+ # Shared Skill Operating Baseline
2
+
3
+ Use this document to keep SKILL bodies compact.
4
+ Skill files should reference this baseline and only restate skill-specific additions or overrides.
5
+
6
+ ## User Questions (AskUserQuestion Protocol)
7
+
8
+ - When a question to the user is needed, use AskUserQuestion if the tool is available.
9
+ - When AskUserQuestion supports structured choices, prefer structured choices over free-text input.
10
+ - If AskUserQuestion is unavailable, ask the same question in a normal message with explicit numbered choices.
11
+ - Preserve structured choice semantics when falling back.
12
+ - State why AskUserQuestion was unavailable.
13
+
14
+ ## FORMAT SSOT (Mandatory)
15
+
16
+ - Before writing or editing `.qfai/**`, read the relevant README/template/sample for the target artifact.
17
+ - Do not copy templates or samples into prompt markdown.
18
+ - Generated artifacts must match README-defined structure, headings, ordering, and table columns.
19
+ - Completion requires a format self-check in evidence.
20
+
21
+ ## Stage 0 - Steering completion refresh (mandatory)
22
+
23
+ Refresh these files before or during the stage when facts are missing or stale:
24
+
25
+ - `.qfai/assistant/steering/manifest.md`
26
+ - `.qfai/assistant/steering/product.md`
27
+ - `.qfai/assistant/steering/structure.md`
28
+ - `.qfai/assistant/steering/tech.md`
29
+
30
+ Rules:
31
+
32
+ - Detect incomplete content such as empty sections, placeholder-only text, `<...>`, `TBD`, or stale facts.
33
+ - Fill only what is verifiable from repository evidence.
34
+ - If something cannot be verified, record an Open Question and ask the user.
35
+ - Update steering when new facts are discovered during the stage.
36
+
37
+ ## Delta Rejected Guard (Mandatory)
38
+
39
+ - Do not reintroduce options marked as rejected in `09_delta.md`.
40
+ - If a rejected option must be reconsidered, create a `[RE-OPEN]` decision record that references the prior DR-ID, states what changed, and includes explicit approval.
41
+
42
+ ## Completion Contract (Shared)
43
+
44
+ Before declaring completion, you MUST:
45
+
46
+ - resolve or explicitly defer undefined or ambiguous items with rationale;
47
+ - verify every expected artifact exists and required sections are populated;
48
+ - scan generated artifacts for unresolved placeholders such as `TBD`, `TODO`, `TBA`, `TBC`, `XXX`, `???`, `OQ`, `OPEN QUESTION`, `UNDEFINED`, and `PLACEHOLDER`;
49
+ - run the smallest applicable smoke check, or state "not applicable" with a short rationale.
@@ -30,21 +30,16 @@ QFAI Skill Body (SSOT)
30
30
 
31
31
  ## User Questions (AskUserQuestion Protocol)
32
32
 
33
- - When a question to the user is needed (e.g., test scope decisions, runtime environment confirmation),
34
- the agent MUST use AskUserQuestion if the tool is available.
35
- - When AskUserQuestion supports structured choices (radio/multi-select),
36
- the agent MUST prefer structured choices over free-text input.
37
- - If AskUserQuestion is technically unavailable, present the same question as a normal message
38
- with explicit numbered choices.
39
- The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
40
- The reason for unavailability MUST be stated.
33
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#user-questions-askuserquestion-protocol`.
34
+
35
+ Skill-specific examples:
36
+
37
+ - test scope decisions
38
+ - runtime environment confirmation
41
39
 
42
40
  ## FORMAT SSOT (Mandatory)
43
41
 
44
- - Before writing or editing any `.qfai/**` artifact, read and follow the relevant directory README template and sample.
45
- - Do not copy templates/samples into this prompt or other prompt markdown.
46
- - Generated artifacts must match README-defined structure (headings, ordering, table columns).
47
- - Completion requires a format self-check in evidence.
42
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#format-ssot-mandatory`.
48
43
 
49
44
  ## Inputs Priority (Preflight)
50
45
 
@@ -78,36 +73,26 @@ When unsure, read inputs in this order:
78
73
 
79
74
  ## Sub-agent Delegation (MANDATORY)
80
75
 
81
- This section is mandatory and overrides any conflicting fallback text in this file.
76
+ Follow `.qfai/assistant/instructions/shared-skill-delegation-baseline.md`.
82
77
 
83
78
  ### Orchestrator Protocol (MUST)
84
79
 
85
- - Orchestrator may only create work orders, delegate tasks, integrate outputs, and present results.
80
+ - Follow the shared baseline.
81
+ - Orchestrator MUST NOT self-approve.
86
82
  - Orchestrator MUST NOT generate the primary artifact first draft.
87
- - Orchestrator MUST NOT serve as Reviewer or skip delegation for convenience.
88
83
 
89
84
  ### Capability Probe (MUST)
90
85
 
91
- 1. Run one harmless Probe Task (for example: "reply with ok") once at stage start.
92
- 2. If subagents are unavailable, explicitly ask the user for Simulation mode approval.
93
- 3. Without explicit approval, stop the stage and do not continue.
86
+ - No additional overrides.
94
87
 
95
- ### Simulation mode (Opt-in only)
88
+ ### Delegation Failure (Hard Stop)
96
89
 
97
- - Allowed only when the user explicitly states `Simulation mode allowed`.
98
- - When used, record both in outputs/evidence:
99
- - `Subagents: simulated (reason: <why unavailable>)`
100
- - `User approval: <quote or reference>`
90
+ - No additional overrides.
91
+ - Do not simulate roles. If the first required delegation fails, stop the stage and report remediation.
101
92
 
102
93
  ## Work Orders Summary
103
94
 
104
- Every major artifact in this stage MUST include this fixed table schema:
105
-
106
- | Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
107
- | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
108
- | 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
109
-
110
- - `Output (refs)` must point to in-file anchors or relative evidence file paths.
95
+ Use the shared schema.
111
96
 
112
97
  ### Stage Minimum Roles (MUST)
113
98
 
@@ -120,77 +105,37 @@ Every major artifact in this stage MUST include this fixed table schema:
120
105
 
121
106
  ### Reviewer Gate (MUST)
122
107
 
108
+ - Follow `.qfai/assistant/instructions/shared-skill-delegation-baseline.md#reviewer-gate-baseline`.
123
109
  - Final completion gate MUST be delegated to an independent `completion-reviewer`.
124
- - Reviewer checks (minimum):
125
- - Required roles were delegated (no orchestrator self-authoring).
126
- - Drift Protocol enforced (no upstream edits without approval and owner rerun).
127
- - Test-layer policy enforced via `test-layers.md`.
128
- - Coverage obligations met: E2E covers `US`, Integration covers `TC`, API covers `CON-API`.
129
- - **Test-case quality depth verified**: Coverage Depth Matrix reviewed; no unjustified ❌ cells remain (see `references/test-case-depth-checklist.md`).
130
- - Validation evidence exists and `qfai validate --fail-on error` passes.
131
- - Floors/ratios are signals, not gates.
132
- - `scenario.feature` and coverage ledgers are optional legacy inputs, not completion gates.
110
+ - ATDD-specific reviewer checks:
111
+ - coverage obligations met: E2E covers `US`, Integration covers `TC`, API covers `CON-API`;
112
+ - Coverage Depth Matrix is reviewed and no unjustified `X` cells remain;
113
+ - validation evidence exists and `qfai validate --fail-on error` passes;
114
+ - `scenario.feature` and coverage ledgers remain optional legacy inputs, not completion gates.
133
115
  - Route specialist reviewers from `.qfai/assistant/steering/agent-routing.yml`.
134
116
  - Default ATDD review set:
135
117
  - `completion-reviewer`
136
118
  - `qa-gatekeeper`
137
119
  - Add `implementation-reviewer` only when helper/runtime support code changed.
138
120
  - Do not declare DONE until all routed blocking reviewers return `PASS`.
139
- - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL.
140
121
 
141
122
  ### Work order template (copy/paste)
142
123
 
143
- ```text
144
- Task title: <short>
145
- Role: <sub-agent role>
146
- Goal: <what to decide/produce>
147
- Inputs (refs):
148
- - <file/section>
149
- Constraints:
150
- - must: enforce Drift Protocol (no upstream edits without user approval + CR)
151
- - must: verify test-layer obligations from `steering/test-layers.md`
152
- - must: provide validation evidence (`qfai validate --fail-on error`)
153
- - must_not: treat volume ratios/floors as hard gates
154
- - must_not: accept upstream edits made directly by downstream phase
155
- Output format:
156
- - <headings / bullet schema>
157
- Quality bar:
158
- - PASS if ...
159
- - REVISE if ...
160
- ```
124
+ Use the shared template.
161
125
 
162
126
  ### Reviewer response template
163
127
 
164
- ```text
165
- Result: PASS | REVISE
166
- Findings:
167
- - <issue>
168
- Required fixes:
169
- - <action>
170
- Evidence checked:
171
- - <refs>
172
- ```
128
+ Use the shared template.
173
129
 
174
- ## Stage 0 Steering completion refresh (mandatory)
175
-
176
- Before moving forward in this stage, refresh:
177
-
178
- - `.qfai/assistant/steering/manifest.md`
179
- - `.qfai/assistant/steering/product.md`
180
- - `.qfai/assistant/steering/structure.md`
181
- - `.qfai/assistant/steering/tech.md`
130
+ - Required field: `Status (PASS/REVISE)`.
182
131
 
183
- Rules:
132
+ ## Stage 0 — Steering completion refresh (mandatory)
184
133
 
185
- - Detect incomplete content (empty sections, placeholder-only lines, `<...>`, `TBD`, stale facts).
186
- - Fill what is verifiable from repository evidence.
187
- - If something cannot be verified, record an Open Question and ask the user.
188
- - Update steering when new facts are discovered during this stage.
134
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#stage-0---steering-completion-refresh-mandatory`.
189
135
 
190
136
  ## Delta Rejected Guard (Mandatory)
191
137
 
192
- - Do not reintroduce options marked as rejected in 09_delta.md.
193
- - If a rejected option must be reconsidered, create a `[RE-OPEN]` Decision Record that references prior DR-ID and explicit approval.
138
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#delta-rejected-guard-mandatory`.
194
139
 
195
140
  ## CRITICAL CONSTRAINTS (Read First)
196
141
 
@@ -212,12 +157,7 @@ Rules:
212
157
 
213
158
  ## Completion Contract (Shared)
214
159
 
215
- Before declaring completion, you MUST:
216
-
217
- - Resolve or explicitly defer undefined/ambiguous items with rationale.
218
- - Verify every expected artifact exists and required sections are populated.
219
- - Scan generated artifacts for unresolved placeholders (`TBD`, `TODO`, `???`, etc.).
220
- - Run the smallest smoke check proving runnable behavior (or state "not applicable" with rationale).
160
+ Follow `.qfai/assistant/instructions/shared-skill-operating-baseline.md#completion-contract-shared`.
221
161
 
222
162
  ## Goal
223
163