qfai 1.5.4 → 1.5.6

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.
package/README.md CHANGED
@@ -17,6 +17,10 @@ The agent reads the repository, produces the required artifacts, and iterates un
17
17
 
18
18
  ## Quick start
19
19
 
20
+ > **Windows users:** `qfai init` creates symlinks internally.
21
+ > You must enable **Developer Mode** (Settings → System → For developers → Developer Mode: ON)
22
+ > before running `npx qfai init`, otherwise symlink creation will fail due to insufficient privileges.
23
+
20
24
  ```bash
21
25
  # 1) Initialize QFAI assets in your repository
22
26
  npx qfai init
@@ -246,7 +250,7 @@ flowchart LR
246
250
  - Contracts SSOT: `.qfai/contracts/**`
247
251
  - Report outputs (`.qfai/report/**`) are derived artifacts and not SSOT.
248
252
 
249
- ## Minimal tutorial (v1.5.4)
253
+ ## Minimal tutorial (v1.5.6)
250
254
 
251
255
  1. `npx qfai init`
252
256
  2. Run `/qfai-discussion` to structure scope, open questions, and produce a discussion pack under `.qfai/discussion/discussion-<ts>/`.
@@ -10,6 +10,11 @@ update_frequency: occasional
10
10
 
11
11
  Delegate work to specialized roles to reduce blind spots and improve quality.
12
12
 
13
+ ## Feedback quality rule (all agents)
14
+
15
+ - Every sub-agent MUST include a concrete alternative or fix proposal when submitting FAIL verdicts or other negative feedback.
16
+ - Negative feedback without a concrete alternative is invalid and triggers re-judgment.
17
+
13
18
  ## Default delegation map
14
19
 
15
20
  - **Researcher**: collect pre-knowledge (English sources), glossary, risks, and question angles
@@ -34,6 +39,14 @@ Delegate work to specialized roles to reduce blind spots and improve quality.
34
39
  - **Runtime Gatekeeper**: runtime evidence and smoke verification
35
40
  - **Prototyping Coverage Auditor**: detect missing spec rows and unresolved checks in prototyping coverage evidence
36
41
  - **Doc Steward**: doc impact analysis and README/mermaid updates
42
+ - **Devil's Advocate (devils-advocate)**: challenge all assumptions as fundamentally wrong, provide concrete alternatives for every objection
43
+ - Responsibility: review under the premise that everything is wrong; use nitpicking, reductio ad absurdum, and forced analogy to present a concrete vision of the ideal state
44
+ - Delegation rule: executes after existing 10 reviewers (11th). FAIL must include alternative proposal. Bare negation FAIL is invalid. 3 consecutive FAILs trigger advisory demotion (current cycle only)
45
+ - Selection scenario: mandatory in every skill review cycle (can_be_na: false). Purpose: uncover blind spots in design, specs, and requirements
46
+ - **Pattern Doubler (pattern-doubler)**: demand 2x the current ID-bearing pattern count, propose concrete additions with rationale
47
+ - Responsibility: demand doubling of ID-bearing items (US, AC, BR, EX, TC) by identifying missing perspectives and proposing additions with justification
48
+ - Delegation rule: executes after devils-advocate (12th). Rationale for each proposed addition is required
49
+ - Selection scenario: executes in /qfai-sdd review cycles. N/A allowed only when spec pack has no ID-bearing items (can_be_na: true)
37
50
 
38
51
  ## If subagents are not supported
39
52
 
@@ -31,6 +31,17 @@ QFAI Skill Body (SSOT)
31
31
 
32
32
  [DRIFT-PROTOCOL:MANDATORY]
33
33
 
34
+ ## User Questions (AskUserQuestion Protocol)
35
+
36
+ - When a question to the user is needed (e.g., test scope decisions, runtime environment confirmation),
37
+ the agent MUST use AskUserQuestion if the tool is available.
38
+ - When AskUserQuestion supports structured choices (radio/multi-select),
39
+ the agent MUST prefer structured choices over free-text input.
40
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
41
+ with explicit numbered choices.
42
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
43
+ The reason for unavailability MUST be stated.
44
+
34
45
  ## FORMAT SSOT (Mandatory)
35
46
 
36
47
  - Before writing or editing any `.qfai/**` artifact, read and follow the relevant directory README template and sample.
@@ -120,6 +131,14 @@ Every major artifact in this stage MUST include this fixed table schema:
120
131
  - Floors/ratios are signals, not gates.
121
132
  - `scenario.feature` and coverage ledgers are optional legacy inputs, not completion gates.
122
133
  - Do not declare DONE until Reviewer returns `PASS`.
134
+ - **All reviewers: alternative proposal obligation**:
135
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
136
+ - **devils-advocate gate**:
137
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
138
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
139
+ - **pattern-doubler gate**:
140
+ - Each pattern proposed by pattern-doubler must include rationale.
141
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
123
142
 
124
143
  ### Work order template (copy/paste)
125
144
 
@@ -18,6 +18,17 @@ QFAI Skill Body (SSOT)
18
18
 
19
19
  [DRIFT-PROTOCOL:MANDATORY]
20
20
 
21
+ ## User Questions (AskUserQuestion Protocol)
22
+
23
+ - When a question to the user is needed (e.g., configuration decisions, glob pattern confirmation),
24
+ the agent MUST use AskUserQuestion if the tool is available.
25
+ - When AskUserQuestion supports structured choices (radio/multi-select),
26
+ the agent MUST prefer structured choices over free-text input.
27
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
28
+ with explicit numbered choices.
29
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
30
+ The reason for unavailability MUST be stated.
31
+
21
32
  ## FORMAT SSOT (Mandatory)
22
33
 
23
34
  - **Before writing or editing any `.qfai/**` artifact\*\*, read and follow the relevant directory README template and sample:
@@ -92,6 +103,14 @@ Every major artifact in this stage MUST include a `## Work Orders Summary` secti
92
103
  - E2E/API/Integration coverage aligns with `steering/test-layers.md` and the project’s plan.
93
104
  - Do not use pyramid ratios as a gate; use floors/ratios only as signals. Coverage obligations are the gate.
94
105
  - Do not declare DONE or handoff until Reviewer returns `PASS`.
106
+ - **All reviewers: alternative proposal obligation**:
107
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
108
+ - **devils-advocate gate**:
109
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
110
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
111
+ - **pattern-doubler gate**:
112
+ - Each pattern proposed by pattern-doubler must include rationale.
113
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
95
114
 
96
115
  ### Work order template (copy/paste)
97
116
 
@@ -18,6 +18,17 @@ QFAI Skill Body (SSOT)
18
18
 
19
19
  [DRIFT-PROTOCOL:MANDATORY]
20
20
 
21
+ ## User Questions (AskUserQuestion Protocol)
22
+
23
+ - When a question to the user is needed (e.g., Simulation mode approval, scope confirmation),
24
+ the agent MUST use AskUserQuestion if the tool is available.
25
+ - When AskUserQuestion supports structured choices (radio/multi-select),
26
+ the agent MUST prefer structured choices over free-text input.
27
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
28
+ with explicit numbered choices.
29
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
30
+ The reason for unavailability MUST be stated.
31
+
21
32
  ## FORMAT SSOT (Mandatory)
22
33
 
23
34
  - Before writing artifacts, read and follow:
@@ -63,6 +74,14 @@ Every major artifact in this stage MUST include this table schema:
63
74
  - Reviewer must check Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
64
75
  - Test volume floors/ratios are not gates; they are risk signals.
65
76
  - Do not declare DONE until Reviewer returns `PASS`; otherwise apply `REVISE`.
77
+ - **All reviewers: alternative proposal obligation**:
78
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
79
+ - **devils-advocate gate**:
80
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
81
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
82
+ - **pattern-doubler gate**:
83
+ - Each pattern proposed by pattern-doubler must include rationale.
84
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
66
85
 
67
86
  ## CRITICAL CONSTRAINTS (Read First)
68
87
 
@@ -221,6 +240,14 @@ RCP rules:
221
240
  - Any `FAIL` requires return/fix/full rerun from the first reviewer.
222
241
  - Mark fixed only when all reviewers are `PASS` or valid `N/A`.
223
242
  - `summary.json` `target.kind` must be `"discussion"`.
243
+ - Execution order: existing 10 reviewers (1-10) → devils-advocate (11) → pattern-doubler (12).
244
+ - devils-advocate (11th):
245
+ - `can_be_na: false` — N/A is not allowed.
246
+ - FAIL must include a concrete alternative. Bare negation FAIL is invalid.
247
+ - 3 consecutive FAILs trigger advisory demotion (current review cycle only).
248
+ - pattern-doubler (12th):
249
+ - `can_be_na: true` — N/A is default in discussion phase as ID-bearing items are sparse.
250
+ - Evaluates Example Seeds count and perspective coverage.
224
251
 
225
252
  ## RCP Footer Include (MUST)
226
253
 
@@ -89,3 +89,29 @@
89
89
  - 復旧: 1本でよいので、登場人物(ペルソナ)と主要分岐が分かる flowchart を入れる
90
90
  - FAIL: pack 名が不正(latest 判定がブレる)
91
91
  - 復旧: 不正 pack を `discussion-legacy-*` に退避し、最新 pack を timestamp 命名で作り直す
92
+
93
+ ---
94
+
95
+ ## 拡張レビュアー
96
+
97
+ ### devils-advocate(11番目)
98
+
99
+ - 役割: 全否定エージェント — 「現状すべてが間違っている」前提でレビューし、あるべき姿を提示する
100
+ - `can_be_na: false` — N/A は許可されない
101
+ - FAIL 判定時は必ず具体的代替案を提示すること。代替案なしの FAIL は無効とし、再判定を要求する
102
+ - 3 回連続 FAIL → アドバイザリー降格(当該レビューサイクル限定)。降格後はブロッキング力が消失し、フィードバックのみ記録する
103
+ - レビュー記録: `R11_devils-advocate.md`
104
+
105
+ ### pattern-doubler(12番目)
106
+
107
+ - 役割: パターン倍増エージェント — discussion phase では ID 付き項目が少ないため N/A が基本
108
+ - `can_be_na: true` — discussion phase では Example Seeds の数と観点網羅性を評価対象とする
109
+ - N/A でない場合、追加パターンの根拠提示が必須
110
+ - レビュー記録: `R12_pattern-doubler.md`
111
+
112
+ ### 代表的な FAIL と復旧(拡張レビュアー特化)
113
+
114
+ - FAIL (devils-advocate): 代替案なしの否定のみ
115
+ - 復旧: 具体的な「あるべき姿」と移行パスを記述させ、再判定する
116
+ - FAIL (devils-advocate, 3回連続): 無限ループ検知
117
+ - 復旧: アドバイザリー降格を記録し、devils-advocate のフィードバックを advisory として保存。次フェーズに進行する
@@ -29,6 +29,17 @@ QFAI Skill Body (SSOT)
29
29
 
30
30
  [DRIFT-PROTOCOL:MANDATORY]
31
31
 
32
+ ## User Questions (AskUserQuestion Protocol)
33
+
34
+ - When a question to the user is needed (e.g., implementation scope decisions, runtime environment confirmation),
35
+ the agent MUST use AskUserQuestion if the tool is available.
36
+ - When AskUserQuestion supports structured choices (radio/multi-select),
37
+ the agent MUST prefer structured choices over free-text input.
38
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
39
+ with explicit numbered choices.
40
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
41
+ The reason for unavailability MUST be stated.
42
+
32
43
  Run prototyping as an **all-spec stage**. Scope is fixed to **ALL specs** resolved from `.qfai/specs/spec-*`.
33
44
 
34
45
  This stage is complete only when all specs pass the minimum runtime contract:
@@ -124,6 +135,14 @@ Every major artifact in this stage MUST include this table:
124
135
  - test-layer obligations match `test-layers.md` and plan,
125
136
  - floors and ratios are **signals, not gates**.
126
137
  - Reviewer returns only `PASS` or `REVISE`.
138
+ - **All reviewers: alternative proposal obligation**:
139
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
140
+ - **devils-advocate gate**:
141
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
142
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
143
+ - **pattern-doubler gate**:
144
+ - Each pattern proposed by pattern-doubler must include rationale.
145
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
127
146
 
128
147
  ### Work order template (copy/paste)
129
148
 
@@ -28,6 +28,17 @@ QFAI Skill Body (SSOT)
28
28
 
29
29
  [DRIFT-PROTOCOL:MANDATORY]
30
30
 
31
+ ## User Questions (AskUserQuestion Protocol)
32
+
33
+ - When a question to the user is needed (e.g., OQ resolution, NFR priority decisions),
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.
41
+
31
42
  ## FORMAT SSOT (Mandatory)
32
43
 
33
44
  - Before writing or editing any `.qfai/**` artifact, read and follow:
@@ -140,6 +151,14 @@ Every major artifact in this stage MUST include a `## Work Orders Summary` secti
140
151
  - `tests/integration/**` -> `QFAI:SPEC-XXXX:TC-YYYY`
141
152
  - `tests/api/**` -> `QFAI:CON-API-XXXX` (and no TC annotations)
142
153
  - Do not declare DONE or handoff until Reviewer returns `PASS`.
154
+ - **All reviewers: alternative proposal obligation**:
155
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
156
+ - **devils-advocate gate**:
157
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
158
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
159
+ - **pattern-doubler gate**:
160
+ - Each pattern proposed by pattern-doubler must include rationale.
161
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
143
162
 
144
163
  ### Work order template (copy/paste)
145
164
 
@@ -183,6 +202,15 @@ Evidence checked:
183
202
  - Allowed reviewer verdicts: `PASS`, `FAIL`, `N/A` (`N/A` requires `na_rule` reason).
184
203
  - Any `FAIL` triggers return/fix/full-rerun from the first reviewer.
185
204
  - `fixed` is forbidden until all reviewers are `PASS` or valid `N/A`.
205
+ - Execution order: existing 10 reviewers (1-10) → devils-advocate (11) → pattern-doubler (12).
206
+ - devils-advocate (11th):
207
+ - `can_be_na: false` — N/A is not allowed.
208
+ - FAIL must include a concrete alternative. Bare negation FAIL is invalid.
209
+ - 3 consecutive FAILs trigger advisory demotion (current review cycle only). Blocking power is lost after demotion.
210
+ - pattern-doubler (12th):
211
+ - `can_be_na: true` — N/A only when the target artifact has no ID-bearing items.
212
+ - Sets a 2x target for current ID-bearing items (US, AC, BR, EX, TC) and identifies missing patterns.
213
+ - Rationale for each proposed addition is required.
186
214
 
187
215
  ## Stage 0 - Steering completion refresh (mandatory)
188
216
 
@@ -82,3 +82,32 @@ discussion-pack 等の共通規約ではありません。
82
82
  - 復旧: 先に Glossary/Capabilities を補強し、契約を spec に合わせて修正する
83
83
  - FAIL: decision/rejected が薄く、なぜそうしたかが追えない
84
84
  - 復旧: 代替案A/B/Cと採用基準を書き、Rejected に DO NOT/Temptation を残す
85
+
86
+ ---
87
+
88
+ ## 拡張レビュアー
89
+
90
+ ### devils-advocate(11番目)
91
+
92
+ - 役割: 全否定エージェント — 「現状すべてが間違っている」前提でレビューし、あるべき姿を提示する
93
+ - `can_be_na: false` — N/A は許可されない
94
+ - FAIL 判定時は必ず具体的代替案を提示すること。代替案なしの FAIL は無効とし、再判定を要求する
95
+ - 3 回連続 FAIL → アドバイザリー降格(当該レビューサイクル限定)。降格後はブロッキング力が消失し、フィードバックのみ記録する
96
+ - レビュー記録: `R11_devils-advocate.md`
97
+
98
+ ### pattern-doubler(12番目)
99
+
100
+ - 役割: パターン倍増エージェント — ID 付き項目(US, AC, BR, EX, TC)の数を現状の 2 倍にする提案を行う
101
+ - `can_be_na: true` — ID 付き項目のない成果物の場合のみ N/A 可
102
+ - 追加パターンの根拠提示が必須。根拠なしの追加要求は無効
103
+ - カウント対象: US/AC/BR/EX/TC プレフィックスの連番形式 ID を持つ項目のみ
104
+ - レビュー記録: `R12_pattern-doubler.md`
105
+
106
+ ### 代表的な FAIL と復旧(拡張レビュアー特化)
107
+
108
+ - FAIL (devils-advocate): 代替案なしの否定のみ
109
+ - 復旧: 具体的な「あるべき姿」と移行パスを記述させ、再判定する
110
+ - FAIL (devils-advocate, 3回連続): 無限ループ検知
111
+ - 復旧: アドバイザリー降格を記録し、devils-advocate のフィードバックを advisory として保存。次フェーズに進行する
112
+ - FAIL (pattern-doubler): 根拠なしの倍増要求
113
+ - 復旧: 各追加パターンに「なぜ必要か」(境界値/負例/権限/状態遷移/冪等性)の観点を付与させる
@@ -18,6 +18,17 @@ QFAI Skill Body (SSOT)
18
18
 
19
19
  [DRIFT-PROTOCOL:MANDATORY]
20
20
 
21
+ ## User Questions (AskUserQuestion Protocol)
22
+
23
+ - When a question to the user is needed (e.g., Simulation mode approval),
24
+ the agent MUST use AskUserQuestion if the tool is available.
25
+ - When AskUserQuestion supports structured choices (radio/multi-select),
26
+ the agent MUST prefer structured choices over free-text input.
27
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
28
+ with explicit numbered choices.
29
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
30
+ The reason for unavailability MUST be stated.
31
+
21
32
  ## Deprecation Notice (MUST)
22
33
 
23
34
  - This command is deprecated.
@@ -57,6 +68,14 @@ QFAI Skill Body (SSOT)
57
68
  - Reviewer checks Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
58
69
  - Test volume floors/ratios are not gates; they are signals.
59
70
  - Completion requires reviewer result `PASS`; otherwise `REVISE`.
71
+ - **All reviewers: alternative proposal obligation**:
72
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
73
+ - **devils-advocate gate**:
74
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
75
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
76
+ - **pattern-doubler gate**:
77
+ - Each pattern proposed by pattern-doubler must include rationale.
78
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
60
79
 
61
80
  ## CRITICAL CONSTRAINTS (Read First)
62
81
 
@@ -18,6 +18,17 @@ QFAI Skill Body (SSOT)
18
18
 
19
19
  [DRIFT-PROTOCOL:MANDATORY]
20
20
 
21
+ ## User Questions (AskUserQuestion Protocol)
22
+
23
+ - When a question to the user is needed (e.g., Simulation mode approval),
24
+ the agent MUST use AskUserQuestion if the tool is available.
25
+ - When AskUserQuestion supports structured choices (radio/multi-select),
26
+ the agent MUST prefer structured choices over free-text input.
27
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
28
+ with explicit numbered choices.
29
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
30
+ The reason for unavailability MUST be stated.
31
+
21
32
  ## Deprecation Notice (MUST)
22
33
 
23
34
  - This command is deprecated.
@@ -57,6 +68,14 @@ QFAI Skill Body (SSOT)
57
68
  - Reviewer checks Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
58
69
  - Test volume floors/ratios are not gates; they are signals.
59
70
  - Completion requires reviewer result `PASS`; otherwise `REVISE`.
71
+ - **All reviewers: alternative proposal obligation**:
72
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
73
+ - **devils-advocate gate**:
74
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
75
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
76
+ - **pattern-doubler gate**:
77
+ - Each pattern proposed by pattern-doubler must include rationale.
78
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
60
79
 
61
80
  ## CRITICAL CONSTRAINTS (Read First)
62
81
 
@@ -18,6 +18,17 @@ QFAI Skill Body (SSOT)
18
18
 
19
19
  [DRIFT-PROTOCOL:MANDATORY]
20
20
 
21
+ ## User Questions (AskUserQuestion Protocol)
22
+
23
+ - When a question to the user is needed (e.g., Simulation mode approval),
24
+ the agent MUST use AskUserQuestion if the tool is available.
25
+ - When AskUserQuestion supports structured choices (radio/multi-select),
26
+ the agent MUST prefer structured choices over free-text input.
27
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
28
+ with explicit numbered choices.
29
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
30
+ The reason for unavailability MUST be stated.
31
+
21
32
  ## Deprecation Notice (MUST)
22
33
 
23
34
  - This command is deprecated.
@@ -57,6 +68,14 @@ QFAI Skill Body (SSOT)
57
68
  - Reviewer checks Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
58
69
  - Test volume floors/ratios are not gates; they are signals.
59
70
  - Completion requires reviewer result `PASS`; otherwise `REVISE`.
71
+ - **All reviewers: alternative proposal obligation**:
72
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
73
+ - **devils-advocate gate**:
74
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
75
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
76
+ - **pattern-doubler gate**:
77
+ - Each pattern proposed by pattern-doubler must include rationale.
78
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
60
79
 
61
80
  ## CRITICAL CONSTRAINTS (Read First)
62
81
 
@@ -18,6 +18,17 @@ QFAI Skill Body (SSOT)
18
18
 
19
19
  [DRIFT-PROTOCOL:MANDATORY]
20
20
 
21
+ ## User Questions (AskUserQuestion Protocol)
22
+
23
+ - When a question to the user is needed (e.g., gate failure triage, fix approach confirmation),
24
+ the agent MUST use AskUserQuestion if the tool is available.
25
+ - When AskUserQuestion supports structured choices (radio/multi-select),
26
+ the agent MUST prefer structured choices over free-text input.
27
+ - If AskUserQuestion is technically unavailable, present the same question as a normal message
28
+ with explicit numbered choices.
29
+ The agent SHOULD preserve structured choice semantics (enumerated options, selection constraints).
30
+ The reason for unavailability MUST be stated.
31
+
21
32
  ## FORMAT SSOT (Mandatory)
22
33
 
23
34
  - **Before writing or editing any `.qfai/**` artifact\*\*, read and follow the relevant directory README template and sample:
@@ -38,6 +49,12 @@ When unsure, read inputs in this order:
38
49
  - P3: `.qfai/specs/<spec-id>/09_delta.md` (Decision Records; if no spec yet, state "not applicable")
39
50
  - P4: other artifacts (01_Spec.md, contracts, evidence, optional legacy `scenario.feature` / coverage ledgers)
40
51
 
52
+ ## Verify Scope Rule (Mandatory)
53
+
54
+ - `/qfai-verify` MUST always run full-scan verification.
55
+ - Do NOT use Preflight Diff (or any diff-only shortcut) in this skill.
56
+ - Preserve the DR-0007/spec-0011 intent: verify is the safety gate and must not be reduced to incremental checks.
57
+
41
58
  ## Sub-agent Delegation (MANDATORY)
42
59
 
43
60
  This section is mandatory and overrides any conflicting fallback text in this file.
@@ -92,6 +109,14 @@ Every major artifact in this stage MUST include a `## Work Orders Summary` secti
92
109
  - E2E/API/Integration coverage aligns with `steering/test-layers.md` and the project’s plan.
93
110
  - Do not use pyramid ratios as a gate; use floors/ratios only as signals. Coverage obligations are the gate.
94
111
  - Do not declare DONE or handoff until Reviewer returns `PASS`.
112
+ - **All reviewers: alternative proposal obligation**:
113
+ - Every reviewer MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment.
114
+ - **devils-advocate gate**:
115
+ - devils-advocate FAIL must include a concrete alternative proposal. Bare negation FAIL triggers re-judgment.
116
+ - 3 consecutive FAILs trigger advisory demotion and allow progression to the next phase.
117
+ - **pattern-doubler gate**:
118
+ - Each pattern proposed by pattern-doubler must include rationale.
119
+ - Artifacts with no ID-bearing items (US/AC/BR/EX/TC) are marked N/A.
95
120
 
96
121
  ### Work order template (copy/paste)
97
122
 
@@ -28,7 +28,7 @@ optional:
28
28
  - Delta
29
29
 
30
30
  reviewers:
31
- minimum: 10
31
+ minimum: 12
32
32
  roster_ssot: .qfai/assistant/steering/review-roster.yml
33
33
  required:
34
34
  - id: qa-lead
@@ -51,6 +51,10 @@ reviewers:
51
51
  role: Design Review Lead
52
52
  - id: runtime-gatekeeper
53
53
  role: Runtime Gatekeeper
54
+ - id: devils-advocate
55
+ role: Devil's Advocate
56
+ - id: pattern-doubler
57
+ role: Pattern Doubler
54
58
 
55
59
  quality_gates:
56
60
  validate:
@@ -84,3 +88,28 @@ quality_gates:
84
88
  role: Design Review Lead
85
89
  - id: runtime-gatekeeper
86
90
  role: Runtime Gatekeeper
91
+ - id: devils-advocate
92
+ role: Devil's Advocate
93
+ - id: pattern-doubler
94
+ role: Pattern Doubler
95
+
96
+ extended_reviewers:
97
+ devils-advocate:
98
+ execution_order: 11
99
+ can_be_na: false
100
+ fail_rules:
101
+ - alternative_required: true
102
+ - bare_negation_invalid: true
103
+ escalation:
104
+ consecutive_fail_limit: 3
105
+ action: advisory_demotion
106
+ scope: current_review_cycle
107
+ effect: non_blocking_feedback_only
108
+ pattern-doubler:
109
+ execution_order: 12
110
+ can_be_na: true
111
+ na_rule: "Allowed only if target artifact has no ID-bearing spec items (US/AC/BR/EX/TC)."
112
+ fail_rules:
113
+ - rationale_required: true
114
+ - count_target: "2x current ID-bearing items"
115
+ - count_scope: "US, AC, BR, EX, TC prefixed sequential IDs only"
@@ -1,5 +1,9 @@
1
1
  schema_version: "1.0"
2
2
 
3
+ feedback_policy:
4
+ alternative_required: true
5
+ description: "All reviewers MUST provide a concrete alternative or fix proposal when returning FAIL. Feedback without a concrete alternative is invalid and triggers re-judgment."
6
+
3
7
  roster:
4
8
  - id: qa-lead
5
9
  name: Quality Lead
@@ -90,3 +94,35 @@ roster:
90
94
  - Verify mitigation and rollback assumptions.
91
95
  can_be_na: true
92
96
  na_rule: "Allowed only if no runtime/operations impact exists."
97
+
98
+ - id: devils-advocate
99
+ name: Devil's Advocate
100
+ scope: [discuss, require, sdd]
101
+ must_check:
102
+ - Challenge every assumption, conclusion, and design decision as if it were fundamentally wrong.
103
+ - Provide a concrete desired-state alternative for every issue raised; bare negation without an alternative is invalid.
104
+ - Persist with objections using any rhetorical means (nitpicking, reductio ad absurdum, forced analogy) to surface hidden risks.
105
+ can_be_na: false
106
+ na_rule: "N/A is not allowed for this reviewer."
107
+ behavioral_principles:
108
+ premise: "Assume the current state is fundamentally incorrect."
109
+ stance: "Challenge assumptions aggressively and present objections clearly, even under uncertainty."
110
+ requirement: "When returning FAIL, always provide a concrete alternative proposal."
111
+ escalation:
112
+ consecutive_fail_limit: 3
113
+ demotion: advisory
114
+ demotion_scope: current_review_cycle
115
+
116
+ - id: pattern-doubler
117
+ name: Pattern Doubler
118
+ scope: [discuss, require, sdd]
119
+ must_check:
120
+ - Count all ID-bearing items (US, AC, BR, EX, TC) in the target spec and demand at least 2x the current count.
121
+ - Identify missing perspectives (boundary, negative, permission, state-transition, idempotency) and propose concrete additions with rationale.
122
+ - Persist with demands using any rhetorical means (edge-case invention, combinatorial explosion, analogy) to maximize pattern coverage.
123
+ can_be_na: true
124
+ na_rule: "Allowed only if the target artifact contains no ID-bearing spec items (US/AC/BR/EX/TC)."
125
+ behavioral_principles:
126
+ premise: "Current pattern coverage is insufficient."
127
+ stance: "Push clearly for at least 2x pattern coverage and challenge under-specified cases."
128
+ requirement: "Justify added patterns and set the doubling target from counts of ID-bearing items."
@@ -1483,8 +1483,8 @@ var import_promises7 = require("fs/promises");
1483
1483
  var import_node_path8 = __toESM(require("path"), 1);
1484
1484
  var import_node_url2 = require("url");
1485
1485
  async function resolveToolVersion() {
1486
- if ("1.5.4".length > 0) {
1487
- return "1.5.4";
1486
+ if ("1.5.6".length > 0) {
1487
+ return "1.5.6";
1488
1488
  }
1489
1489
  try {
1490
1490
  const packagePath = resolvePackageJsonPath();
@@ -1460,8 +1460,8 @@ import { readFile as readFile5 } from "fs/promises";
1460
1460
  import path8 from "path";
1461
1461
  import { fileURLToPath as fileURLToPath2 } from "url";
1462
1462
  async function resolveToolVersion() {
1463
- if ("1.5.4".length > 0) {
1464
- return "1.5.4";
1463
+ if ("1.5.6".length > 0) {
1464
+ return "1.5.6";
1465
1465
  }
1466
1466
  try {
1467
1467
  const packagePath = resolvePackageJsonPath();
package/dist/index.cjs CHANGED
@@ -3970,8 +3970,8 @@ var import_promises14 = require("fs/promises");
3970
3970
  var import_node_path14 = __toESM(require("path"), 1);
3971
3971
  var import_node_url = require("url");
3972
3972
  async function resolveToolVersion() {
3973
- if ("1.5.4".length > 0) {
3974
- return "1.5.4";
3973
+ if ("1.5.6".length > 0) {
3974
+ return "1.5.6";
3975
3975
  }
3976
3976
  try {
3977
3977
  const packagePath = resolvePackageJsonPath();
package/dist/index.mjs CHANGED
@@ -3889,8 +3889,8 @@ import { readFile as readFile11 } from "fs/promises";
3889
3889
  import path14 from "path";
3890
3890
  import { fileURLToPath } from "url";
3891
3891
  async function resolveToolVersion() {
3892
- if ("1.5.4".length > 0) {
3893
- return "1.5.4";
3892
+ if ("1.5.6".length > 0) {
3893
+ return "1.5.6";
3894
3894
  }
3895
3895
  try {
3896
3896
  const packagePath = resolvePackageJsonPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qfai",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "Quality-first AI-driven development toolkit (SDD × ATDD × TDD).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -50,6 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@types/jsdom": "^21.1.7",
52
52
  "@types/node": "^18.19.41",
53
+ "qfai": "^1.5.4",
53
54
  "tsup": "^8.3.5",
54
55
  "typescript": "^5.6.3",
55
56
  "vitest": "^2.1.8"