qfai 1.5.1 → 1.5.3

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 (34) hide show
  1. package/README.md +5 -3
  2. package/assets/init/.qfai/README.md +2 -1
  3. package/assets/init/.qfai/assistant/agents/prototyping-coverage-auditor.md +1 -1
  4. package/assets/init/.qfai/assistant/instructions/drift-protocol.md +1 -1
  5. package/assets/init/.qfai/assistant/instructions/requirements-decomposition.md +4 -4
  6. package/assets/init/.qfai/assistant/instructions/workflow.md +2 -2
  7. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +17 -2
  8. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +4 -4
  9. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md +91 -0
  10. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +15 -4
  11. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +46 -44
  12. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md +84 -0
  13. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/03_Capabilities.md +1 -1
  14. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/04_Business-Flow.md +1 -1
  15. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/05_Contracts.md +1 -1
  16. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/01_Spec.md +38 -0
  17. package/assets/init/.qfai/assistant/skills/qfai-tdd-green/SKILL.md +1 -0
  18. package/assets/init/.qfai/assistant/skills/qfai-tdd-red/SKILL.md +1 -0
  19. package/assets/init/.qfai/assistant/skills/qfai-tdd-refactor/SKILL.md +1 -0
  20. package/assets/init/.qfai/specs/README.md +14 -7
  21. package/assets/init/.qfai/specs/_policies/.gitkeep +1 -0
  22. package/dist/cli/index.cjs +73 -66
  23. package/dist/cli/index.cjs.map +1 -1
  24. package/dist/cli/index.mjs +73 -66
  25. package/dist/cli/index.mjs.map +1 -1
  26. package/dist/index.cjs +71 -64
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.mjs +71 -64
  29. package/dist/index.mjs.map +1 -1
  30. package/package.json +1 -1
  31. package/assets/init/.qfai/assistant/templates/rcp_footer.md +0 -93
  32. /package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/08_Decisions.md +0 -0
  33. /package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/09_Open-questions.md +0 -0
  34. /package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/10_delta.md +0 -0
package/README.md CHANGED
@@ -246,7 +246,7 @@ flowchart LR
246
246
  - Contracts SSOT: `.qfai/contracts/**`
247
247
  - Report outputs (`.qfai/report/**`) are derived artifacts and not SSOT.
248
248
 
249
- ## Minimal tutorial (v1.5.1)
249
+ ## Minimal tutorial (v1.5.3)
250
250
 
251
251
  1. `npx qfai init`
252
252
  2. Run `/qfai-discussion` to structure scope, open questions, and produce a discussion pack under `.qfai/discussion/discussion-<ts>/`.
@@ -340,10 +340,14 @@ Typical customizations.
340
340
  │ │ │ ├── qfai-configure
341
341
  │ │ │ │ └── SKILL.md
342
342
  │ │ │ ├── qfai-discussion
343
+ │ │ │ │ ├── references
344
+ │ │ │ │ │ └── rcp_footer.md
343
345
  │ │ │ │ └── SKILL.md
344
346
  │ │ │ ├── qfai-prototyping
345
347
  │ │ │ │ └── SKILL.md
346
348
  │ │ │ ├── qfai-sdd
349
+ │ │ │ │ ├── references
350
+ │ │ │ │ │ └── rcp_footer.md
347
351
  │ │ │ │ └── SKILL.md
348
352
  │ │ │ ├── qfai-atdd
349
353
  │ │ │ │ └── SKILL.md
@@ -357,8 +361,6 @@ Typical customizations.
357
361
  │ │ │ └── SKILL.md
358
362
  │ │ ├── skills.local
359
363
  │ │ │ └── README.md
360
- │ │ ├── templates
361
- │ │ │ └── rcp_footer.md
362
364
  │ │ ├── steering
363
365
  │ │ │ ├── README.md
364
366
  │ │ │ ├── review-gate.rules.yml
@@ -98,7 +98,8 @@ It is useful for local review but should not pollute version control.
98
98
 
99
99
  ### R4. Layered specs are runtime SSOT
100
100
 
101
- - Runtime validators and downstream skills consume `_shared/**` and `spec-XXXX/**`.
101
+ - Runtime validators consume `_policies/**` and `spec-XXXX/**`.
102
+ - Execution skills enter from `spec-XXXX/01_Spec.md` and read `_policies/**` only through the spec's Escalation Hook.
102
103
  - Split rule is fixed: `1 CAP = 1 spec`.
103
104
  - Parent chain is fixed: `US -> CAP`, `AC -> US`, `BR -> AC`, `EX -> BR|AC`, `TC -> EX`.
104
105
  - Derived outputs under `.qfai/report/**` are non-SSOT.
@@ -9,7 +9,7 @@
9
9
  - `.qfai/assistant/instructions/*`
10
10
  - `.qfai/assistant/steering/*`
11
11
  - `.qfai/specs/spec-*`
12
- - `.qfai/specs/_shared/05_Contracts.md`
12
+ - `.qfai/specs/_policies/05_Contracts.md`
13
13
  - prototyping markdown evidence artifact in the evidence directory
14
14
  - prototyping json evidence artifact in the evidence directory
15
15
 
@@ -9,7 +9,7 @@ This file defines mandatory change control for all downstream execution phases.
9
9
  Upstream artifacts include, at minimum:
10
10
 
11
11
  - `01_Spec.md`, `02_User-stories.md`, `03_Acceptance-Criteria.md`, `04_Business-Rules.md`, `05_Examples.md`, `06_Test-Cases.md`, `07_Decisions.md`, `08_Open-questions.md`, `09_delta.md`
12
- - `_shared/*` layered artifacts and `11_Contracts.md` (or project-equivalent contract index)
12
+ - `_policies/*` layered artifacts and `11_Contracts.md` (or project-equivalent contract index)
13
13
  - `10_Plan.md` and other owner-phase planning outputs
14
14
  - Legacy spec-pack SSOT files when present: `spec.md`, `delta.md`, `plan.md`, `traceability-matrix.md`, `scenario.feature`, `case-catalogue.md`, and numbered pack files (for example `01_Spec.md`..`18_delta.md`)
15
15
  - contracts and schema decisions owned by earlier phases
@@ -15,7 +15,7 @@ This document is the decision rule SSOT for AI and humans when answering:
15
15
  1. **Source registry** (`require/require-*/01_Sources.md`)
16
16
  2. **Requirement index** (`require/require-*/03_REQ.md`)
17
17
  3. **Input gaps / Open Questions** (`require/require-*/08_OQ.md`)
18
- 4. **Shared specs** (`specs/_shared/01..04`)
18
+ 4. **Policy layer** (`specs/_policies/01..04`)
19
19
  5. **Capability slices** (`specs/spec-*/01..05` minimum)
20
20
  6. **ATDD / TDD** (tests + code)
21
21
 
@@ -35,21 +35,21 @@ This document is the decision rule SSOT for AI and humans when answering:
35
35
  ### Rule 3 - Keep ambiguity explicit
36
36
 
37
37
  - Unknowns remain explicit as Open Questions.
38
- - Resolved answers are promoted to `_shared` or `spec-XXXX` artifacts, then OQ status is updated.
38
+ - Resolved answers are promoted to `_policies` or `spec-XXXX` artifacts, then OQ status is updated.
39
39
 
40
40
  ## How to decompose (mechanical procedure)
41
41
 
42
42
  1. Register source documents and assumptions in `require-*/01_Sources.md`.
43
43
  2. Extract concise requirement index entries in `require-*/03_REQ.md`.
44
44
  3. Capture missing information in `require-*/08_OQ.md`.
45
- 4. Build `_shared` layer (`Objective`, `Initiative`, `Capabilities`, `Business Flow`).
45
+ 4. Build `_policies` layer (`Objective`, `Initiative`, `Capabilities`, `Business Flow`).
46
46
  5. Split by capability (`1 CAP = 1 spec-XXXX`) and produce slice files.
47
47
  6. Derive acceptance tests and implementation from the finalized slices.
48
48
 
49
49
  ## Example
50
50
 
51
51
  - Requirement index entry: `REQ-0003` linked to `SRC-0002`
52
- - Capability mapping: `CAP-0003` in `_shared/03_Capabilities.md`
52
+ - Capability mapping: `CAP-0003` in `_policies/03_Capabilities.md`
53
53
  - Spec slice: `spec-0003/01_Spec.md` through `06_Test-Cases.md`
54
54
 
55
55
  ## Non-goals
@@ -49,7 +49,7 @@ Do not proceed without a declared Change Type.
49
49
  0. Steering refresh (project memory bootstrap)
50
50
  1. Discussion (optional): clarify idea → requirement seed
51
51
  2. Requirements: requirements document in `.qfai/require/`
52
- 3. Specification (SDD): unified preflight + `_shared` / `spec-XXXX/01..10`
52
+ 3. Specification (SDD): unified preflight + `_policies` / `spec-XXXX/01..10`
53
53
  4. Prototyping (optional): contract-aligned implementation skeleton
54
54
  5. Acceptance tests (ATDD): runnable E2E/API/Integration tests derived from specs/contracts obligations (`US` / `TC` / `CON-API`)
55
55
  6. Verify: run quality gates and provide evidence
@@ -57,7 +57,7 @@ Do not proceed without a declared Change Type.
57
57
  Stage 3 (`/qfai-sdd`) target policy:
58
58
 
59
59
  - With argument (`/qfai-sdd <spec-id-or-name>`): scope is the matched single spec only.
60
- - Without argument (`/qfai-sdd`): scope is all capabilities from `.qfai/specs/_shared/03_Capabilities.md` in order.
60
+ - Without argument (`/qfai-sdd`): scope is all capabilities from `.qfai/specs/_policies/03_Capabilities.md` in order.
61
61
  - For no-argument batch runs, execute Contracts-first and Outline once, then delegate Slice/Plan/Delta in parallel per `spec-XXXX`.
62
62
 
63
63
  Prototyping stage policy:
@@ -33,15 +33,30 @@ When unsure, read inputs in this order:
33
33
 
34
34
  - P1: `.qfai/assistant/instructions/*`
35
35
  - P2: `.qfai/assistant/steering/*`
36
- - P3: `.qfai/specs/<spec-id>/09_delta.md` (Decision Records; if no spec yet, state "not applicable")
36
+ - P3: `.qfai/specs/<spec-id>/01_Spec.md` (Primary SSOT / Consumer View)
37
37
  - P4: specs/contracts obligations
38
38
  - `.qfai/specs/<spec-id>/02_User-stories.md` (US)
39
+ - `.qfai/specs/<spec-id>/03_Acceptance-Criteria.md` (AC)
40
+ - `.qfai/specs/<spec-id>/05_Examples.md` (EX)
39
41
  - `.qfai/specs/<spec-id>/06_Test-Cases.md` (TC)
40
42
  - `.qfai/contracts/api/**` (CON-API)
41
- - P5: legacy artifacts (optional only)
43
+ - P5: `.qfai/specs/<spec-id>/09_delta.md` (Decision Records; if no spec yet, state "not applicable")
44
+ - P6: legacy artifacts (optional only)
42
45
  - `.qfai/specs/<spec-id>/scenario.feature`
43
46
  - coverage ledger files
44
47
 
48
+ ## Read Set Contract (Mandatory)
49
+
50
+ - Default Mode:
51
+ - `.qfai/specs/<spec-id>/01_Spec.md`
52
+ - `.qfai/specs/<spec-id>/03_Acceptance-Criteria.md`
53
+ - `.qfai/specs/<spec-id>/05_Examples.md`
54
+ - `.qfai/specs/<spec-id>/06_Test-Cases.md`
55
+ - Escalation Mode:
56
+ - allowed only when `01_Spec.md` Escalation Hook signals ambiguity / conflict / missing constraint / trade-off
57
+ - read only `.qfai/specs/_policies/01_Objective.md` and `.qfai/specs/_policies/08_Decisions.md`
58
+ - Do not read `_policies/**` by default.
59
+
45
60
  ## Sub-agent Delegation (MANDATORY)
46
61
 
47
62
  This section is mandatory and overrides any conflicting fallback text in this file.
@@ -28,7 +28,7 @@ mode: interactive-by-default
28
28
  - `.qfai/specs/README.md`
29
29
  - `.qfai/evidence/README.md`
30
30
  - `.qfai/assistant/steering/review-roster.yml`
31
- - `.qfai/assistant/templates/rcp_footer.md`
31
+ - `.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md`
32
32
  - Keep templates as source of truth and preserve file naming/order.
33
33
 
34
34
  ## Sub-agent Delegation (MANDATORY)
@@ -93,7 +93,7 @@ Every major artifact in this stage MUST include this table schema:
93
93
  - `03_Story-Workshop.md` MUST contain at least one Mermaid diagram in ` ```mermaid ` fences.
94
94
  - If UI requirements exist, include an HTML+CSS visual mock in `03_Story-Workshop.md`.
95
95
  - Review roster is fixed by `.qfai/assistant/steering/review-roster.yml` and must be executed in full.
96
- - RCP wording must be sourced from `.qfai/assistant/templates/rcp_footer.md`.
96
+ - RCP wording must be sourced from `.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md`.
97
97
  - Discussion artifacts are logs/rationale and must not duplicate spec SSOT.
98
98
  - If diagrams are written, Mermaid syntax must be in ` ```mermaid ` fences only.
99
99
  - Do not enforce fixed EX/BR or TC/EX ratios in this phase.
@@ -220,14 +220,14 @@ For each review cycle, create:
220
220
  RCP rules:
221
221
 
222
222
  - Append-only: create a new review pack for each cycle.
223
- - Apply `.qfai/assistant/templates/rcp_footer.md` as the common footer rule set.
223
+ - Apply `.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md` as the common footer rule set.
224
224
  - Any `FAIL` requires return/fix/full rerun from the first reviewer.
225
225
  - Mark fixed only when all reviewers are `PASS` or valid `N/A`.
226
226
  - `summary.json` `target.kind` must be `"discussion"`.
227
227
 
228
228
  ## RCP Footer Include (MUST)
229
229
 
230
- - Include and follow `.qfai/assistant/templates/rcp_footer.md` without rewriting it per skill.
230
+ - Include and follow `.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md` without rewriting it per skill.
231
231
  - Roster and loop rules must stay synchronized with the footer SSOT.
232
232
 
233
233
  ## Required Coverage Topics
@@ -0,0 +1,91 @@
1
+ # RCP Footer (qfai-discussion / SSOT)
2
+
3
+ この文書は `/qfai-discussion` のレビュー周回(Review Cycle)を「discussion-pack 前提」で固定するための SSOT です。
4
+ 他skill向けの共通規約ではありません。
5
+
6
+ ---
7
+
8
+ ## Review Target(固定)
9
+
10
+ - Scope: `discussion`
11
+ - Pack: `.qfai/discussion/discussion-<YYYYMMDDhhmmssSSS>/`
12
+ - レビュー対象(必須15ファイル):
13
+ - `01_Context.md`
14
+ - `02_Inception-Deck.md`
15
+ - `03_Story-Workshop.md`
16
+ - `04_Sources.md`
17
+ - `05_Scope.md`
18
+ - `06_REQ.md`
19
+ - `07_NFR.md`
20
+ - `08_Glossary.md`
21
+ - `09_Constraints.md`
22
+ - `10_Policy.md`
23
+ - `11_OQ-Register.md`
24
+ - `12_OQ-Resolution-Log.md`
25
+ - `13_Deferred.md`
26
+ - `14_Review-Request.md`
27
+ - `99_delta.md`
28
+
29
+ ---
30
+
31
+ ## Roster Execution Rule(固定)
32
+
33
+ - Roster は `.qfai/assistant/steering/review-roster.yml` を読む
34
+ - 各レビューは `PASS` / `FAIL` / `N/A` を返す
35
+ - `N/A` は `na_rule` を満たす理由が必須
36
+ - `FAIL` が1つでも出たら **即修正へ戻る**(後続レビューは回さない)
37
+ - 修正後は **review cycle を新規作成し** roster を先頭から再実行する(スキップ禁止)
38
+
39
+ ---
40
+
41
+ ## Validate Hard Gate(必須)
42
+
43
+ - 各 review cycle で `qfai validate --fail-on error --format github` を実行していること
44
+ - `.qfai/report/validate.log` が存在し、最新の成果物に対応していること
45
+
46
+ ---
47
+
48
+ ## discussion-pack 固有の Gate(必須)
49
+
50
+ 以下は validator が **error** として扱うため、`fixed` 判定前に必ず潰す:
51
+
52
+ 1. 命名(最新pack判定)
53
+
54
+ - pack は `discussion-YYYYMMDDhhmmssSSS/` のみ許可
55
+ - 不正な `discussion-*` がある場合は latest 判定が壊れるため、退避または削除する
56
+
57
+ 2. Blocking OQ の解消
58
+
59
+ - `11_OQ-Register.md` の **Disposition が `open` のまま**で、
60
+ かつ Gate が `discuss|require|sdd` の OQ が残っていないこと
61
+ - `open` を残す場合は、**Gateを外す**か `Disposition: deferred/resolved` に変更する
62
+
63
+ 3. Deferred の整合
64
+
65
+ - OQ register で `deferred` にした OQ-ID は、`13_Deferred.md` に同じ OQ-ID で必ず記載する
66
+
67
+ 4. Story Workshop の Mermaid(最小要件)
68
+
69
+ - `03_Story-Workshop.md` に mermaid fenced block を最低1つ含める
70
+ - `flowchart` または `sequenceDiagram` を推奨
71
+
72
+ ---
73
+
74
+ ## レビュー観点(discussion-pack 特化)
75
+
76
+ - Context → Inception Deck → Story Workshop の因果が通っているか
77
+ - 「なぜ作るか」→「誰のためか」→「どんな業務フローか」が矛盾しない
78
+ - `06_REQ.md` と `07_NFR.md` の境界が崩れていないか
79
+ - Glossary/Constraints/Policy が単なる箇条書きでなく、意思決定(後工程の設計/実装)の入力として使える粒度か
80
+ - `99_delta.md` が “更新履歴” ではなく “検討ログ(採用/不採用/基準)” を持っているか
81
+
82
+ ---
83
+
84
+ ## 代表的な FAIL と復旧(discussion-pack 特化)
85
+
86
+ - FAIL: `11_OQ-Register.md` に open+Gate が残る
87
+ - 復旧: 影響範囲が大きいものは `Disposition: deferred` + `13_Deferred.md` に詳細を移す
88
+ - FAIL: `03_Story-Workshop.md` に図がない
89
+ - 復旧: 1本でよいので、登場人物(ペルソナ)と主要分岐が分かる flowchart を入れる
90
+ - FAIL: pack 名が不正(latest 判定がブレる)
91
+ - 復旧: 不正 pack を `discussion-legacy-*` に退避し、最新 pack を timestamp 命名で作り直す
@@ -59,9 +59,20 @@ When unsure, read inputs in this order:
59
59
 
60
60
  - P1: `.qfai/assistant/instructions/*`
61
61
  - P2: `.qfai/assistant/steering/*`
62
- - P3: `.qfai/specs/spec-*/09_delta.md` (Decision Records)
63
- - P4: `.qfai/specs/_shared/05_Contracts.md` and each `spec-*/11_Contracts.md`
64
- - P5: `.qfai/contracts/**` and existing evidence
62
+ - P3: `.qfai/specs/spec-*/01_Spec.md` (Primary SSOT / Consumer View)
63
+ - P4: `.qfai/contracts/ui/**`, `.qfai/specs/_policies/05_Contracts.md`, and each `spec-*/11_Contracts.md`
64
+ - P5: `.qfai/specs/spec-*/09_delta.md` (Decision Records)
65
+ - P6: existing evidence
66
+
67
+ ## Read Set Contract (Mandatory)
68
+
69
+ - Default Mode:
70
+ - `.qfai/specs/spec-*/01_Spec.md`
71
+ - relevant `.qfai/contracts/ui/**`
72
+ - Escalation Mode:
73
+ - allowed only when `01_Spec.md` Escalation Hook signals ambiguity / conflict / missing constraint / trade-off
74
+ - read only `.qfai/specs/_policies/01_Objective.md`, `.qfai/specs/_policies/07_Constraints.md`, `.qfai/specs/_policies/08_Decisions.md`
75
+ - Do not read `_policies/**` by default.
65
76
 
66
77
  ## Sub-agent Delegation (MANDATORY)
67
78
 
@@ -195,7 +206,7 @@ Build the minimum runnable vertical slice for **all specs** so `/qfai-atdd` can
195
206
  ## Scope SSOT (ALL contracts -> ALL specs)
196
207
 
197
208
  1. Enumerate all specs from `.qfai/specs/spec-*`.
198
- 2. Resolve each spec's contracts via `_shared/05_Contracts.md` and/or `spec-*/11_Contracts.md`.
209
+ 2. Resolve each spec's contracts via `_policies/05_Contracts.md` and/or `spec-*/11_Contracts.md`.
199
210
  3. Do not declare completion while any spec lacks contract assignment.
200
211
 
201
212
  ## Preflight (required)
@@ -8,7 +8,7 @@ QFAI Skill Body (SSOT)
8
8
 
9
9
  name: qfai-sdd
10
10
  title: QFAI SDD Unified (Outline/Slice/Plan/Delta)
11
- description: "Create and update layered SDD artifacts (\_shared + spec-XXXX) in one workflow."
11
+ description: "Create and update layered SDD artifacts (\_policies + spec-XXXX) in one workflow."
12
12
  argument-hint: "[<spec-id-or-name>] [--auto]"
13
13
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
14
14
  roles: [Planner, Architect, RequirementsAnalyst, SpecWriter, TraceabilityBuilder, TestStrategist, QAEngineer, CodeReviewer]
@@ -28,7 +28,7 @@ mode: approval-gated
28
28
  - `.qfai/contracts/**/README.md`
29
29
  - `.qfai/evidence/README.md`
30
30
  - `.qfai/assistant/steering/review-roster.yml`
31
- - `.qfai/assistant/templates/rcp_footer.md`
31
+ - `.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md`
32
32
  - Use skill-local templates as SSOT:
33
33
  - `.qfai/assistant/skills/qfai-sdd/templates/report/preflight_summary.md`
34
34
  - Do NOT duplicate templates directly in this workflow markdown.
@@ -94,7 +94,7 @@ Every major artifact in this stage MUST include a `## Work Orders Summary` secti
94
94
  ### No-argument batch delegation (MUST)
95
95
 
96
96
  - If `/qfai-sdd` is invoked without `<spec-id-or-name>`, treat the run as an all-capability batch.
97
- - Enumerate targets from `.qfai/specs/_shared/03_Capabilities.md` and keep `spec-0001..N` mapping stable by Capability order.
97
+ - Enumerate targets from `.qfai/specs/_policies/03_Capabilities.md` and keep `spec-0001..N` mapping stable by Capability order.
98
98
  - In batch mode, run Contracts-first and Outline exactly once as shared outputs.
99
99
  - Delegate Slice in parallel per spec:
100
100
  - `SpecWriter + TraceabilityBuilder` own `spec-XXXX/01..08`.
@@ -170,7 +170,7 @@ Evidence checked:
170
170
  ## Review Cycle Protocol (RCP)
171
171
 
172
172
  - Roster SSOT: `.qfai/assistant/steering/review-roster.yml`.
173
- - Footer SSOT: `.qfai/assistant/templates/rcp_footer.md`.
173
+ - Footer SSOT: `.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md`.
174
174
  - Every discuss/require/sdd review cycle must execute the full roster.
175
175
  - Allowed reviewer verdicts: `PASS`, `FAIL`, `N/A` (`N/A` requires `na_rule` reason).
176
176
  - Any `FAIL` triggers return/fix/full-rerun from the first reviewer.
@@ -203,14 +203,14 @@ Rules:
203
203
  - **Upper-to-lower references are forbidden. Lower-to-upper references are allowed.**
204
204
  - **Connections between layers MUST be represented by IDs and required edges (`US->AC->BR->EX->TC`).**
205
205
  - **Plan finalize MUST happen after at least one user-story slice is grounded.**
206
- - **Unresolved items MUST be moved to `08_Open-questions.md` (spec scope) or `_shared/09_Open-questions.md` (shared scope).**
206
+ - **Unresolved items MUST be moved to `08_Open-questions.md` (spec scope) or `_policies/09_Open-questions.md` (shared scope).**
207
207
 
208
208
  ## Arguments and Target Selection (Mandatory)
209
209
 
210
210
  - With argument (`/qfai-sdd <spec-id-or-name> [--auto]`): update only the matched single spec target.
211
- - Without argument (`/qfai-sdd`): target all capabilities listed in `_shared/03_Capabilities.md`.
212
- - If `_shared/03_Capabilities.md` does not exist, bootstrap shared templates first, then enumerate capabilities.
213
- - Capability order in `_shared/03_Capabilities.md` is SSOT for `spec-0001..N` assignment and ID stability.
211
+ - Without argument (`/qfai-sdd`): target all capabilities listed in `_policies/03_Capabilities.md`.
212
+ - If `_policies/03_Capabilities.md` does not exist, bootstrap shared templates first, then enumerate capabilities.
213
+ - Capability order in `_policies/03_Capabilities.md` is SSOT for `spec-0001..N` assignment and ID stability.
214
214
  - Reordering capability-to-spec mapping is a Change Request decision and must not be done implicitly.
215
215
  - Batch policy (no argument):
216
216
  - Contracts-first/Outline: once per batch.
@@ -226,7 +226,7 @@ Rules:
226
226
  - Always write `.qfai/report/preflight_summary.md` before generating shared/spec artifacts.
227
227
  - Contracts are contract-first mandatory outputs in this skill:
228
228
  - create/update `.qfai/contracts/(api|db|ui)/**` before shared/spec slices
229
- - `_shared/05_Contracts.md` must include a Contract Index with short IDs (`DB-001`, `API-001`, `UI-001`)
229
+ - `_policies/05_Contracts.md` must include a Contract Index with short IDs (`DB-001`, `API-001`, `UI-001`)
230
230
  - every indexed short ID must map to a declared file with `QFAI-CONTRACT-ID`:
231
231
  - `DB-001 -> CON-DB-0001 -> db-0001-<slug>.sql`
232
232
  - `API-001 -> CON-API-0001 -> api-0001-<slug>.yaml`
@@ -237,8 +237,8 @@ Rules:
237
237
  - contract stubs must be syntactically valid (OpenAPI YAML / UI YAML / executable SQL skeleton)
238
238
  - `/qfai-sdd` must stop when discussion-pack is missing/incomplete or has blocking OQ (guide to `/qfai-discussion` first).
239
239
  - Review roster is fixed by `.qfai/assistant/steering/review-roster.yml` and must be executed in full.
240
- - RCP wording must be sourced from `.qfai/assistant/templates/rcp_footer.md`.
241
- - `_shared/04_Business-Flow.md` must be Markdown and include at least one Mermaid `flowchart` or `sequenceDiagram`.
240
+ - RCP wording must be sourced from `.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md`.
241
+ - `_policies/04_Business-Flow.md` must be Markdown and include at least one Mermaid `flowchart` or `sequenceDiagram`.
242
242
  - Business Flow must not be authored as Gherkin (`*Business-flow*.feature` is deprecated).
243
243
  - If diagrams are written in discuss/require/spec/evidence artifacts, Mermaid syntax must be inside ` ```mermaid ` fences only.
244
244
  - `05_Examples.md` must include `EX-ID` and `BR-Ref` mappings.
@@ -266,12 +266,12 @@ Create/update:
266
266
  - `.qfai/contracts/api/**`
267
267
  - `.qfai/contracts/db/**`
268
268
  - `.qfai/contracts/ui/**`
269
- - `_shared/05_Contracts.md` Contract Index table (DB/API/UI short IDs)
269
+ - `_policies/05_Contracts.md` Contract Index table (DB/API/UI short IDs)
270
270
 
271
271
  Rules:
272
272
 
273
273
  - This phase MUST complete before Outline/Slice.
274
- - If `_shared/05_Contracts.md` lists an ID, the corresponding declared contract file MUST exist.
274
+ - If `_policies/05_Contracts.md` lists an ID, the corresponding declared contract file MUST exist.
275
275
  - If a contract is empty, create a valid minimal stub and include `QFAI-CONTRACT-ID`.
276
276
  - `none` is allowed only when there is no contract impact and rationale is written.
277
277
 
@@ -279,22 +279,22 @@ Rules:
279
279
 
280
280
  Create/update:
281
281
 
282
- - `_shared/01_Objective.md`
283
- - `_shared/02_Initiative.md`
284
- - `_shared/03_Capabilities.md`
285
- - `_shared/04_Business-Flow.md`
286
- - `_shared/05_Contracts.md`
287
- - `_shared/06_Glossary.md`
288
- - `_shared/07_Constraints.md`
289
- - `_shared/08_Decisions.md`
290
- - `_shared/09_Open-questions.md`
291
- - `_shared/10_delta.md`
282
+ - `_policies/01_Objective.md`
283
+ - `_policies/02_Initiative.md`
284
+ - `_policies/03_Capabilities.md`
285
+ - `_policies/04_Business-Flow.md`
286
+ - `_policies/05_Contracts.md`
287
+ - `_policies/06_Glossary.md`
288
+ - `_policies/07_Constraints.md`
289
+ - `_policies/08_Decisions.md`
290
+ - `_policies/09_Open-questions.md`
291
+ - `_policies/10_delta.md`
292
292
 
293
293
  Rules:
294
294
 
295
- - Temporary `TBD` is allowed, but each `TBD` must be mirrored into `_shared/09_Open-questions.md`.
296
- - `_shared/04_Business-Flow.md` must include Mermaid and keep diagram syntax inside ` ```mermaid ` fences.
297
- - `_shared/08_Decisions.md` and `_shared/10_delta.md` must exist even when empty, and must explicitly state `0 items`.
295
+ - Temporary `TBD` is allowed, but each `TBD` must be mirrored into `_policies/09_Open-questions.md`.
296
+ - `_policies/04_Business-Flow.md` must include Mermaid and keep diagram syntax inside ` ```mermaid ` fences.
297
+ - `_policies/08_Decisions.md` and `_policies/10_delta.md` must exist even when empty, and must explicitly state `0 items`.
298
298
 
299
299
  ### Phase 2 - Slice (slice-first)
300
300
 
@@ -316,6 +316,7 @@ Slice gate (must pass before Phase 3):
316
316
  - For each TC, EX reference must exist.
317
317
  - `SC` tags must align with the target `spec-XXXX` namespace.
318
318
  - `07_Decisions.md` and `08_Open-questions.md` must exist even when empty and include explicit `0 items` statements.
319
+ - `01_Spec.md` is the execution Primary SSOT and MUST copy down applicable NFR, policy, evidence summary, relevant requirements, and an Escalation Hook to `_policies`.
319
320
 
320
321
  ### Phase 3 - Plan finalize
321
322
 
@@ -366,16 +367,16 @@ Create or update layered SDD artifacts in one run so downstream execution phases
366
367
 
367
368
  ## Mandatory Outputs
368
369
 
369
- - `.qfai/specs/_shared/01_Objective.md`
370
- - `.qfai/specs/_shared/02_Initiative.md`
371
- - `.qfai/specs/_shared/03_Capabilities.md`
372
- - `.qfai/specs/_shared/04_Business-Flow.md`
373
- - `.qfai/specs/_shared/05_Contracts.md`
374
- - `.qfai/specs/_shared/06_Glossary.md`
375
- - `.qfai/specs/_shared/07_Constraints.md`
376
- - `.qfai/specs/_shared/08_Decisions.md`
377
- - `.qfai/specs/_shared/09_Open-questions.md`
378
- - `.qfai/specs/_shared/10_delta.md`
370
+ - `.qfai/specs/_policies/01_Objective.md`
371
+ - `.qfai/specs/_policies/02_Initiative.md`
372
+ - `.qfai/specs/_policies/03_Capabilities.md`
373
+ - `.qfai/specs/_policies/04_Business-Flow.md`
374
+ - `.qfai/specs/_policies/05_Contracts.md`
375
+ - `.qfai/specs/_policies/06_Glossary.md`
376
+ - `.qfai/specs/_policies/07_Constraints.md`
377
+ - `.qfai/specs/_policies/08_Decisions.md`
378
+ - `.qfai/specs/_policies/09_Open-questions.md`
379
+ - `.qfai/specs/_policies/10_delta.md`
379
380
  - `.qfai/specs/spec-XXXX/01_Spec.md`
380
381
  - `.qfai/specs/spec-XXXX/02_User-stories.md`
381
382
  - `.qfai/specs/spec-XXXX/03_Acceptance-Criteria.md`
@@ -396,7 +397,7 @@ Create or update layered SDD artifacts in one run so downstream execution phases
396
397
  2. If readiness checks fail, stop and show blockers with `/qfai-discussion`.
397
398
  3. Analyze repository context, existing artifacts, constraints, and open decisions.
398
399
  4. Write `.qfai/report/preflight_summary.md` from `templates/report/preflight_summary.md`.
399
- 5. Execute Phase 0 (Contracts-first) and ensure `_shared/05_Contracts.md` index and `.qfai/contracts/**` are aligned.
400
+ 5. Execute Phase 0 (Contracts-first) and ensure `_policies/05_Contracts.md` index and `.qfai/contracts/**` are aligned.
400
401
  6. Execute Phase 1 (Outline) in layer-first order.
401
402
  7. Execute Phase 2 (Slice) and pass slice gate for each target spec (single target: at least one user-story slice; no-argument batch: all enumerated specs).
402
403
  8. Execute Phase 3 (Plan finalize) and make every target `10_Plan.md` actionable as How-only.
@@ -410,8 +411,9 @@ Create or update layered SDD artifacts in one run so downstream execution phases
410
411
 
411
412
  Run static checks:
412
413
 
413
- - Confirm required `_shared` and `spec-XXXX` layered files exist.
414
- - Confirm `_shared/04_Business-Flow.md` includes Mermaid and at least one `flowchart` or `sequenceDiagram`.
414
+ - Confirm required `_policies` and `spec-XXXX` layered files exist.
415
+ - Confirm `_policies/04_Business-Flow.md` includes Mermaid and at least one `flowchart` or `sequenceDiagram`.
416
+ - Confirm `01_Spec.md` includes copy-down context and Escalation Hook to `_policies`.
415
417
  - Confirm Mermaid syntax is not written in ` ```text ` or language-less fences.
416
418
  - Confirm `05_Examples.md` provides `EX-ID` + `BR-Ref` mappings.
417
419
  - Confirm `06_Test-Cases.md` provides `TC-ID` + `EX-Ref` + `AC-Refs`.
@@ -457,11 +459,11 @@ When declaring DONE, include:
457
459
  - [ ] CRITICAL CONSTRAINTS were followed.
458
460
  - [ ] `.qfai/report/preflight_summary.md` was generated before spec authoring.
459
461
  - [ ] Contracts-first -> Outline -> Slice -> Plan finalize -> Delta update order was preserved.
460
- - [ ] `_shared/05_Contracts.md` index and `.qfai/contracts/**` declared files are aligned.
462
+ - [ ] `_policies/05_Contracts.md` index and `.qfai/contracts/**` declared files are aligned.
461
463
  - [ ] Upper-to-lower references were not introduced.
462
464
  - [ ] At least one user-story slice passed gate before plan finalization.
463
- - [ ] Required `_shared` + `spec-XXXX` outputs exist and are internally consistent.
464
- - [ ] `_shared/04_Business-Flow.md` is Markdown + Mermaid (`flowchart` or `sequenceDiagram`).
465
+ - [ ] Required `_policies` + `spec-XXXX` outputs exist and are internally consistent.
466
+ - [ ] `_policies/04_Business-Flow.md` is Markdown + Mermaid (`flowchart` or `sequenceDiagram`).
465
467
  - [ ] Mermaid syntax was not written in ` ```text ` or language-less fences.
466
468
  - [ ] `10_Plan.md` is finalized with implementation/test strategy (How-only).
467
469
  - [ ] `specs/plan.md` was not created.
@@ -493,6 +495,6 @@ When this skill is complete, provide a final user-facing completion message and
493
495
  - Test-first path: `/qfai-atdd`.
494
496
  Action: implement acceptance tests from the finalized spec pack.
495
497
  - Contracts status:
496
- Action: confirm contracts were created/updated under `.qfai/contracts/**` and referenced by `_shared/05_Contracts.md`.
498
+ Action: confirm contracts were created/updated under `.qfai/contracts/**` and referenced by `_policies/05_Contracts.md`.
497
499
  - Spec pack needs correction: rerun `/qfai-sdd`.
498
- Action: fix layered `_shared + spec-XXXX` consistency and decision records, then regenerate evidence.
500
+ Action: fix layered `_policies + spec-XXXX` consistency and decision records, then regenerate evidence.
@@ -0,0 +1,84 @@
1
+ # RCP Footer (qfai-sdd / SSOT)
2
+
3
+ この文書は `/qfai-sdd` のレビュー周回(Review Cycle)を「spec/contract 前提」で固定するための SSOT です。
4
+ discussion-pack 等の共通規約ではありません。
5
+
6
+ ---
7
+
8
+ ## Review Target(固定)
9
+
10
+ - Scope: `sdd`
11
+ - 主要成果物(レビュー対象):
12
+ - `.qfai/specs/spec-*/**`(spec pack)
13
+ - `.qfai/contracts/**`(API/DB/UI 契約)
14
+ - `.qfai/evidence/**`(意思決定根拠・実験ログ)
15
+ - `.qfai/report/**`(validate / coverage / preflight 出力)
16
+
17
+ ---
18
+
19
+ ## Roster Execution Rule(固定)
20
+
21
+ - Roster は `.qfai/assistant/steering/review-roster.yml` を読む
22
+ - 各レビューは `PASS` / `FAIL` / `N/A` を返す
23
+ - `FAIL` が1つでも出たら **即修正へ戻る**
24
+ - 修正後は **review cycle を新規作成し** roster を先頭から再実行する(スキップ禁止)
25
+
26
+ ---
27
+
28
+ ## Validate Hard Gate(必須)
29
+
30
+ - 各 review cycle で `qfai validate --fail-on error --format github` を実行していること
31
+ - `.qfai/report/validate.log` が存在し、最新の成果物に対応していること
32
+
33
+ ---
34
+
35
+ ## Required Review Artifacts(必須)
36
+
37
+ 各 review cycle で、以下を必ず生成する:
38
+
39
+ - `.qfai/review/review-<timestamp>/review_request.md`
40
+ - `.qfai/review/review-<timestamp>/R01_<reviewer>.md`, `R02_<reviewer>.md`, ...
41
+ - `.qfai/review/review-<timestamp>/summary.json`
42
+
43
+ `summary.json` の最低要件:
44
+
45
+ - `version`
46
+ - `created_at`
47
+ - `target`
48
+ - `roster`
49
+ - `overall_status`
50
+
51
+ ---
52
+
53
+ ## spec-pack 固有のレビュー観点(sdd 特化)
54
+
55
+ 1. 仕様の一貫性
56
+
57
+ - spec の「目的/スコープ/非スコープ」が、後続の user story / acceptance criteria / examples と矛盾しない
58
+ - “例(Examples)” が acceptance criteria を **具体ケースとして裏付け**ている(単なる繰り返しではない)
59
+
60
+ 2. 意思決定の可観測性(Decision Log)
61
+
62
+ - `delta` / decisions / rejected が「なぜ採用/不採用か」を保持している
63
+ - “Temptation(再発しがちな誤り)” が明文化され、再採用防止になっている
64
+
65
+ 3. Contracts の妥当性
66
+
67
+ - API / UI / DB 契約が spec の用語と一致している(同一概念に別名を付けない)
68
+ - 禁止参照(contracts 特例ルール等)がある場合は、契約側の README のルールに従っている
69
+
70
+ 4. Traceability(必要なら)
71
+
72
+ - spec → tests(ATDD/TDD)への紐付けが破綻していない
73
+ - “数を増やす” のではなく “境界/負例/権限/状態遷移” の観点が埋まっている
74
+
75
+ ---
76
+
77
+ ## 代表的な FAIL と復旧(sdd 特化)
78
+
79
+ - FAIL: acceptance criteria が抽象的で、例に落ちていない
80
+ - 復旧: 例(Examples)に「入力→状態→出力」形式のケースを追加し、境界/異常系を1つは入れる
81
+ - FAIL: 契約が先行し、spec の用語・概念とズレる
82
+ - 復旧: 先に Glossary/Capabilities を補強し、契約を spec に合わせて修正する
83
+ - FAIL: decision/rejected が薄く、なぜそうしたかが追えない
84
+ - 復旧: 代替案A/B/Cと採用基準を書き、Rejected に DO NOT/Temptation を残す
@@ -15,5 +15,5 @@
15
15
 
16
16
  ## Authoring rules
17
17
 
18
- - This file is shared SSOT across all specs.
18
+ - This file is the policy-layer SSOT for capability mapping across all specs.
19
19
  - Do not copy spec-level details (US/AC/BR/EX/TC) into this file.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- - Describe the high-level business process as shared SSOT.
5
+ - Describe the high-level business process as policy-layer SSOT.
6
6
  - Keep acceptance scenarios in `spec-XXXX/03_Acceptance-Criteria.md`.
7
7
 
8
8
  ## Actors / Systems
@@ -3,7 +3,7 @@
3
3
  ## Purpose
4
4
 
5
5
  - Keep contracts as SSOT under `.qfai/contracts/**` with deterministic IDs.
6
- - Use this file as a readable index with short IDs for planning and review.
6
+ - Use this file as a readable policy-layer index with short IDs for planning and review.
7
7
 
8
8
  ## Contract Index
9
9