qfai 1.5.2 → 1.5.4

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 (39) hide show
  1. package/README.md +4 -2
  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 +16 -16
  6. package/assets/init/.qfai/assistant/instructions/workflow.md +3 -3
  7. package/assets/init/.qfai/assistant/manifest/spec_required_files.json +2 -1
  8. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +38 -12
  9. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +19 -12
  10. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +7 -12
  11. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +3 -3
  12. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/summary.json +1 -1
  13. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +34 -14
  14. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +61 -51
  15. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/report/preflight_summary.md +1 -1
  16. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/03_Capabilities.md +1 -1
  17. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/04_Business-Flow.md +1 -1
  18. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/05_Contracts.md +27 -9
  19. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/01_Spec.md +40 -2
  20. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/02_User-stories.md +1 -1
  21. package/assets/init/.qfai/assistant/skills/qfai-tdd-green/SKILL.md +8 -9
  22. package/assets/init/.qfai/assistant/skills/qfai-tdd-red/SKILL.md +8 -9
  23. package/assets/init/.qfai/assistant/skills/qfai-tdd-refactor/SKILL.md +8 -9
  24. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +22 -14
  25. package/assets/init/.qfai/review/.gitignore +2 -0
  26. package/assets/init/.qfai/review/README.md +4 -4
  27. package/assets/init/.qfai/specs/README.md +15 -8
  28. package/dist/cli/index.cjs +298 -366
  29. package/dist/cli/index.cjs.map +1 -1
  30. package/dist/cli/index.mjs +299 -367
  31. package/dist/cli/index.mjs.map +1 -1
  32. package/dist/index.cjs +71 -64
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.mjs +71 -64
  35. package/dist/index.mjs.map +1 -1
  36. package/package.json +1 -1
  37. /package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/08_Decisions.md +0 -0
  38. /package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/{_shared → _policies}/09_Open-questions.md +0 -0
  39. /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.2)
249
+ ## Minimal tutorial (v1.5.4)
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>/`.
@@ -278,7 +278,8 @@ It does not generate GitHub Actions workflows.
278
278
  Configure CI in your own platform and run:
279
279
 
280
280
  ```bash
281
- pnpm ci:local
281
+ pnpm ci:gate
282
+ pnpm check-types:future
282
283
  # or, minimum gate only:
283
284
  npx qfai validate --fail-on error
284
285
  ```
@@ -286,6 +287,7 @@ npx qfai validate --fail-on error
286
287
  Recommended baseline.
287
288
 
288
289
  - Keep CI on default/full validation (`qfai validate --fail-on error`); do not use `--phase refinement` in CI.
290
+ - Keep `pnpm check-types:future` as a separate mandatory gate so future TS compatibility runs once without duplicating `pnpm ci:gate`.
289
291
  - Add a report step (`npx qfai report`) when you need a human-readable artifact.
290
292
  - Tune traceability globs in `qfai.config.yaml` to match your test layout.
291
293
 
@@ -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
@@ -12,11 +12,11 @@ This document is the decision rule SSOT for AI and humans when answering:
12
12
 
13
13
  ## Canonical order (top -> down)
14
14
 
15
- 1. **Source registry** (`require/require-*/01_Sources.md`)
16
- 2. **Requirement index** (`require/require-*/03_REQ.md`)
17
- 3. **Input gaps / Open Questions** (`require/require-*/08_OQ.md`)
18
- 4. **Shared specs** (`specs/_shared/01..04`)
19
- 5. **Capability slices** (`specs/spec-*/01..05` minimum)
15
+ 1. **Source registry** (`.qfai/require/require-*/01_Sources.md`)
16
+ 2. **Requirement index** (`.qfai/require/require-*/03_REQ.md`)
17
+ 3. **Input gaps / Open Questions** (`.qfai/require/require-*/08_OQ.md`)
18
+ 4. **Policy layer** (`.qfai/specs/_policies/01..04`)
19
+ 5. **Capability slices** (`.qfai/specs/spec-*/01..05` minimum)
20
20
  6. **ATDD / TDD** (tests + code)
21
21
 
22
22
  ## Decision rules
@@ -28,32 +28,32 @@ This document is the decision rule SSOT for AI and humans when answering:
28
28
 
29
29
  ### Rule 2 - Preserve layered ownership
30
30
 
31
- - `require/` stores only source/index/gap inputs.
32
- - `specs/` is the SSOT for detailed behavior and design decisions.
33
- - Do not duplicate detailed spec text in `require/`.
31
+ - `.qfai/require/` stores only source/index/gap inputs.
32
+ - `.qfai/specs/` is the SSOT for detailed behavior and design decisions.
33
+ - Do not duplicate detailed spec text in `.qfai/require/`.
34
34
 
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
- 1. Register source documents and assumptions in `require-*/01_Sources.md`.
43
- 2. Extract concise requirement index entries in `require-*/03_REQ.md`.
44
- 3. Capture missing information in `require-*/08_OQ.md`.
45
- 4. Build `_shared` layer (`Objective`, `Initiative`, `Capabilities`, `Business Flow`).
42
+ 1. Register source documents and assumptions in `.qfai/require/require-*/01_Sources.md`.
43
+ 2. Extract concise requirement index entries in `.qfai/require/require-*/03_REQ.md`.
44
+ 3. Capture missing information in `.qfai/require/require-*/08_OQ.md`.
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`
53
- - Spec slice: `spec-0003/01_Spec.md` through `06_Test-Cases.md`
52
+ - Capability mapping: `CAP-0003` in `.qfai/specs/_policies/03_Capabilities.md`
53
+ - Spec slice: `.qfai/specs/spec-0003/01_Spec.md` through `06_Test-Cases.md`
54
54
 
55
55
  ## Non-goals
56
56
 
57
57
  - Managing release status flags in specs.
58
- - Keeping full requirement prose in `require/`.
58
+ - Keeping full requirement prose in `.qfai/require/`.
59
59
  - Treating diagrams as mandatory at require stage.
@@ -2,7 +2,7 @@
2
2
 
3
3
  QFAI standardizes work into a fixed pipeline:
4
4
 
5
- **SDD ATDD TDD Verification**
5
+ ## SDD -> ATDD -> TDD -> Verification
6
6
 
7
7
  This file defines the canonical stages and delegation expectations.
8
8
 
@@ -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:
@@ -8,7 +8,8 @@
8
8
  "06_Test-Cases.md",
9
9
  "07_Decisions.md",
10
10
  "08_Open-questions.md",
11
- "09_delta.md"
11
+ "09_delta.md",
12
+ "10_Plan.md"
12
13
  ],
13
14
  "shared_dir": [
14
15
  "01_Objective.md",
@@ -1,22 +1,33 @@
1
- <!--
2
- QFAI Skill Body (SSOT)
3
- - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
4
- - Keep wrappers thin and route users to this skill body.
5
- -->
6
-
7
1
  ---
8
-
9
2
  name: qfai-atdd
10
3
  title: QFAI ATDD (Executable acceptance tests)
11
4
  description: "Implement automated acceptance tests (E2E/API/Integration) aligned with US/TC/CON-API obligations from specs and contracts."
12
5
  argument-hint: "<spec-id> [--auto]"
13
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
14
- roles: [Orchestrator, TestVolumeEstimator, ATDDE2EImplementer, ATDDAPIImplementer, ATDDIntegrationImplementer, QAEngineer, TestEngineer, BackendEngineer, FrontendEngineer, Reviewer, RuntimeGatekeeper, DevOpsCIEngineer, CodeReviewer]
7
+ roles:
8
+ - Orchestrator
9
+ - TestVolumeEstimator
10
+ - ATDDE2EImplementer
11
+ - ATDDAPIImplementer
12
+ - ATDDIntegrationImplementer
13
+ - QAEngineer
14
+ - TestEngineer
15
+ - BackendEngineer
16
+ - FrontendEngineer
17
+ - Reviewer
18
+ - RuntimeGatekeeper
19
+ - DevOpsCIEngineer
20
+ - CodeReviewer
15
21
  mode: execution-focused
16
-
17
22
  ---
18
23
 
19
- # /qfai-atdd — Implement Automated Acceptance Tests (ATDD)
24
+ <!--
25
+ QFAI Skill Body (SSOT)
26
+ - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
27
+ - Keep wrappers thin and route users to this skill body.
28
+ -->
29
+
30
+ ## /qfai-atdd — Implement Automated Acceptance Tests (ATDD)
20
31
 
21
32
  [DRIFT-PROTOCOL:MANDATORY]
22
33
 
@@ -33,15 +44,30 @@ When unsure, read inputs in this order:
33
44
 
34
45
  - P1: `.qfai/assistant/instructions/*`
35
46
  - P2: `.qfai/assistant/steering/*`
36
- - P3: `.qfai/specs/<spec-id>/09_delta.md` (Decision Records; if no spec yet, state "not applicable")
47
+ - P3: `.qfai/specs/<spec-id>/01_Spec.md` (Primary SSOT / Consumer View)
37
48
  - P4: specs/contracts obligations
38
49
  - `.qfai/specs/<spec-id>/02_User-stories.md` (US)
50
+ - `.qfai/specs/<spec-id>/03_Acceptance-Criteria.md` (AC)
51
+ - `.qfai/specs/<spec-id>/05_Examples.md` (EX)
39
52
  - `.qfai/specs/<spec-id>/06_Test-Cases.md` (TC)
40
53
  - `.qfai/contracts/api/**` (CON-API)
41
- - P5: legacy artifacts (optional only)
54
+ - P5: `.qfai/specs/<spec-id>/09_delta.md` (Decision Records; if no spec yet, state "not applicable")
55
+ - P6: legacy artifacts (optional only)
42
56
  - `.qfai/specs/<spec-id>/scenario.feature`
43
57
  - coverage ledger files
44
58
 
59
+ ## Read Set Contract (Mandatory)
60
+
61
+ - Default Mode:
62
+ - `.qfai/specs/<spec-id>/01_Spec.md`
63
+ - `.qfai/specs/<spec-id>/03_Acceptance-Criteria.md`
64
+ - `.qfai/specs/<spec-id>/05_Examples.md`
65
+ - `.qfai/specs/<spec-id>/06_Test-Cases.md`
66
+ - Escalation Mode:
67
+ - allowed only when `01_Spec.md` Escalation Hook signals ambiguity / conflict / missing constraint / trade-off
68
+ - read only `.qfai/specs/_policies/01_Objective.md` and `.qfai/specs/_policies/08_Decisions.md`
69
+ - Do not read `_policies/**` by default.
70
+
45
71
  ## Sub-agent Delegation (MANDATORY)
46
72
 
47
73
  This section is mandatory and overrides any conflicting fallback text in this file.
@@ -1,11 +1,4 @@
1
- <!--
2
- QFAI Skill Body (SSOT)
3
- - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
4
- - Keep wrappers thin and route users to this skill body.
5
- -->
6
-
7
1
  ---
8
-
9
2
  name: qfai-configure
10
3
  title: QFAI Configure (Tune qfai.config.yaml)
11
4
  description: "Analyze the repository and tune qfai.config.yaml (testFileGlobs, exclude globs, optional specSections)."
@@ -13,10 +6,15 @@ argument-hint: "[--auto]"
13
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task]
14
7
  roles: [DevOpsCIEngineer, QAEngineer, CodeReviewer, Planner]
15
8
  mode: evidence-focused
16
-
17
9
  ---
18
10
 
19
- # /qfai-configure - Configure QFAI for this repository
11
+ <!--
12
+ QFAI Skill Body (SSOT)
13
+ - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
14
+ - Keep wrappers thin and route users to this skill body.
15
+ -->
16
+
17
+ ## /qfai-configure - Configure QFAI for this repository
20
18
 
21
19
  [DRIFT-PROTOCOL:MANDATORY]
22
20
 
@@ -148,7 +146,9 @@ Rules:
148
146
  ## Delta Rejected Guard (Mandatory)
149
147
 
150
148
  - Do NOT reintroduce options marked as rejected in 09_delta.md.
151
- - If a rejected option must be reconsidered, create a **[RE-OPEN]** Decision Record in 09_delta.md that references the prior DR-ID, states what changed + new criteria, and includes explicit approval (user or instructions/steering).
149
+ - If a rejected option must be reconsidered, create a **[RE-OPEN]** Decision
150
+ Record in 09_delta.md that references the prior DR-ID, states what changed +
151
+ new criteria, and includes explicit approval (user or instructions/steering).
152
152
 
153
153
  ## CRITICAL CONSTRAINTS (Read First)
154
154
 
@@ -166,8 +166,15 @@ Before declaring completion, you MUST:
166
166
 
167
167
  - OQ / undefined resolution: detect undefined or ambiguous items; resolve them or explicitly defer them with documented rationale and (when required by this prompt) user approval.
168
168
  - Deliverable completeness: verify every expected artifact listed in this prompt (and required README templates) exists and is fully populated; no missing required sections.
169
- - OQ / placeholder scan: scan all generated artifacts (including evidence) for placeholders such as "TBD", "TODO", "TBA", "TBC", "XXX", "???", "OQ", "OPEN QUESTION", "UNDEFINED", "PLACEHOLDER", and localized equivalents in the user's language. Resolve or explicitly defer; do not leave silent placeholders.
170
- - Smoke check (if applicable): when the prompt produces runnable code/tests/configs, execute the smallest command that proves basic run/start/operate and record evidence. If not applicable, state "not applicable" with a short rationale.
169
+ - OQ / placeholder scan: scan all generated artifacts (including evidence) for
170
+ placeholders such as "TBD", "TODO", "TBA", "TBC", "XXX", "???", "OQ",
171
+ "OPEN QUESTION", "UNDEFINED", "PLACEHOLDER", and localized equivalents in
172
+ the user's language. Resolve or explicitly defer; do not leave silent
173
+ placeholders.
174
+ - Smoke check (if applicable): when the prompt produces runnable code, tests,
175
+ or configs, execute the smallest command that proves basic run/start/operate
176
+ and record evidence. If not applicable, state "not applicable" with a short
177
+ rationale.
171
178
 
172
179
  ## Goal
173
180
 
@@ -1,12 +1,4 @@
1
- ````skill
2
- <!--
3
- QFAI Skill Body (SSOT)
4
- - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
5
- - Keep wrappers thin and route users to this skill body.
6
- -->
7
-
8
1
  ---
9
-
10
2
  name: qfai-discussion
11
3
  title: QFAI Discussion (Unified Discuss + Require)
12
4
  description: "Run structured discussion that merges discuss and require into a single 15-file discussion pack with OQ-driven exit."
@@ -14,10 +6,15 @@ argument-hint: "<idea-or-problem> [--auto]"
14
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
15
7
  roles: [Researcher, Facilitator, Interviewer, RequirementsAnalyst, QAEngineer, Planner]
16
8
  mode: interactive-by-default
17
-
18
9
  ---
19
10
 
20
- # /qfai-discussion - Unified Discuss + Require
11
+ <!--
12
+ QFAI Skill Body (SSOT)
13
+ - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
14
+ - Keep wrappers thin and route users to this skill body.
15
+ -->
16
+
17
+ ## /qfai-discussion - Unified Discuss + Require
21
18
 
22
19
  [DRIFT-PROTOCOL:MANDATORY]
23
20
 
@@ -333,5 +330,3 @@ You MUST end the user-facing output with a handoff sentence to `/qfai-sdd` in th
333
330
  Action: continue discussion loops until OQ states are explicit and complete.
334
331
  - Need additional risk analysis before SDD:
335
332
  Action: update `03_Story-Workshop.md` and `11_OQ-Register.md` with additional findings.
336
-
337
- ````
@@ -1,9 +1,9 @@
1
1
  # Reviewer Result
2
2
 
3
- - reviewer_id: `<qa-lead>`
4
- - reviewer_role: `<Quality Lead>`
3
+ - reviewer_id: `Rxx`
4
+ - reviewer_role: `qa-lead`
5
5
  - verdict: `PASS` <!-- PASS | FAIL | N/A -->
6
- - reviewed_at: `<YYYY-MM-DDThh:mm:ssZ>`
6
+ - reviewed_at: `YYYY-MM-DDThh:mm:ssZ`
7
7
 
8
8
  ## Checked
9
9
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0",
3
- "created_at": "2026-03-03T12:00:00+09:00",
3
+ "created_at": "YYYY-MM-DDThh:mm:ssZ",
4
4
  "target": {
5
5
  "kind": "discussion",
6
6
  "path": ".qfai/discussion/discussion-YYYYMMDDhhmmssSSS"
@@ -1,22 +1,31 @@
1
- <!--
2
- QFAI Skill Body (SSOT)
3
- - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
4
- - Keep wrappers thin and route users to this skill body.
5
- -->
6
-
7
1
  ---
8
-
9
2
  name: qfai-prototyping
10
3
  title: QFAI Prototyping (All-spec runnable skeleton gate)
11
4
  description: "Implement a minimum runnable skeleton for ALL specs and block DONE until evidence + validate gate pass."
12
5
  argument-hint: "[--auto]"
13
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
14
- roles: [FullStackEngineer, BackendEngineer, FrontendEngineer, DBEngineer, DevOpsCIEngineer, QAEngineer, RuntimeGatekeeper, UIUXReviewer, CodeReviewer]
7
+ roles:
8
+ [
9
+ FullStackEngineer,
10
+ BackendEngineer,
11
+ FrontendEngineer,
12
+ DBEngineer,
13
+ DevOpsCIEngineer,
14
+ QAEngineer,
15
+ RuntimeGatekeeper,
16
+ UIUXReviewer,
17
+ CodeReviewer,
18
+ ]
15
19
  mode: execution-focused
16
-
17
20
  ---
18
21
 
19
- # /qfai-prototyping
22
+ <!--
23
+ QFAI Skill Body (SSOT)
24
+ - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
25
+ - Keep wrappers thin and route users to this skill body.
26
+ -->
27
+
28
+ ## /qfai-prototyping
20
29
 
21
30
  [DRIFT-PROTOCOL:MANDATORY]
22
31
 
@@ -59,9 +68,20 @@ When unsure, read inputs in this order:
59
68
 
60
69
  - P1: `.qfai/assistant/instructions/*`
61
70
  - 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
71
+ - P3: `.qfai/specs/spec-*/01_Spec.md` (Primary SSOT / Consumer View)
72
+ - P4: `.qfai/contracts/ui/**`, `.qfai/specs/_policies/05_Contracts.md`, and each `spec-*/11_Contracts.md`
73
+ - P5: `.qfai/specs/spec-*/09_delta.md` (Decision Records)
74
+ - P6: existing evidence
75
+
76
+ ## Read Set Contract (Mandatory)
77
+
78
+ - Default Mode:
79
+ - `.qfai/specs/spec-*/01_Spec.md`
80
+ - relevant `.qfai/contracts/ui/**`
81
+ - Escalation Mode:
82
+ - allowed only when `01_Spec.md` Escalation Hook signals ambiguity / conflict / missing constraint / trade-off
83
+ - read only `.qfai/specs/_policies/01_Objective.md`, `.qfai/specs/_policies/07_Constraints.md`, `.qfai/specs/_policies/08_Decisions.md`
84
+ - Do not read `_policies/**` by default.
65
85
 
66
86
  ## Sub-agent Delegation (MANDATORY)
67
87
 
@@ -195,7 +215,7 @@ Build the minimum runnable vertical slice for **all specs** so `/qfai-atdd` can
195
215
  ## Scope SSOT (ALL contracts -> ALL specs)
196
216
 
197
217
  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`.
218
+ 2. Resolve each spec's contracts via `_policies/05_Contracts.md` and/or `spec-*/11_Contracts.md`.
199
219
  3. Do not declare completion while any spec lacks contract assignment.
200
220
 
201
221
  ## Preflight (required)
@@ -1,22 +1,30 @@
1
- <!--
2
- QFAI Skill Body (SSOT)
3
- - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
4
- - Keep wrappers thin and route users to this skill body.
5
- -->
6
-
7
1
  ---
8
-
9
2
  name: qfai-sdd
10
3
  title: QFAI SDD Unified (Outline/Slice/Plan/Delta)
11
- description: "Create and update layered SDD artifacts (\_shared + spec-XXXX) in one workflow."
4
+ description: "Create and update layered SDD artifacts (\_policies + spec-XXXX) in one workflow."
12
5
  argument-hint: "[<spec-id-or-name>] [--auto]"
13
6
  allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
14
- roles: [Planner, Architect, RequirementsAnalyst, SpecWriter, TraceabilityBuilder, TestStrategist, QAEngineer, CodeReviewer]
7
+ roles:
8
+ [
9
+ Planner,
10
+ Architect,
11
+ RequirementsAnalyst,
12
+ SpecWriter,
13
+ TraceabilityBuilder,
14
+ TestStrategist,
15
+ QAEngineer,
16
+ CodeReviewer,
17
+ ]
15
18
  mode: approval-gated
16
-
17
19
  ---
18
20
 
19
- # /qfai-sdd - Unified SDD Workflow
21
+ <!--
22
+ QFAI Skill Body (SSOT)
23
+ - This file is intended to be referenced by tool-specific wrappers (e.g., GitHub/Claude/Codex skills).
24
+ - Keep wrappers thin and route users to this skill body.
25
+ -->
26
+
27
+ ## /qfai-sdd - Unified SDD Workflow
20
28
 
21
29
  [DRIFT-PROTOCOL:MANDATORY]
22
30
 
@@ -94,7 +102,7 @@ Every major artifact in this stage MUST include a `## Work Orders Summary` secti
94
102
  ### No-argument batch delegation (MUST)
95
103
 
96
104
  - 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.
105
+ - Enumerate targets from `.qfai/specs/_policies/03_Capabilities.md` and keep `spec-0001..N` mapping stable by Capability order.
98
106
  - In batch mode, run Contracts-first and Outline exactly once as shared outputs.
99
107
  - Delegate Slice in parallel per spec:
100
108
  - `SpecWriter + TraceabilityBuilder` own `spec-XXXX/01..08`.
@@ -203,14 +211,14 @@ Rules:
203
211
  - **Upper-to-lower references are forbidden. Lower-to-upper references are allowed.**
204
212
  - **Connections between layers MUST be represented by IDs and required edges (`US->AC->BR->EX->TC`).**
205
213
  - **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).**
214
+ - **Unresolved items MUST be moved to `08_Open-questions.md` (spec scope) or `_policies/09_Open-questions.md` (shared scope).**
207
215
 
208
216
  ## Arguments and Target Selection (Mandatory)
209
217
 
210
218
  - 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.
219
+ - Without argument (`/qfai-sdd`): target all capabilities listed in `_policies/03_Capabilities.md`.
220
+ - If `_policies/03_Capabilities.md` does not exist, bootstrap shared templates first, then enumerate capabilities.
221
+ - Capability order in `_policies/03_Capabilities.md` is SSOT for `spec-0001..N` assignment and ID stability.
214
222
  - Reordering capability-to-spec mapping is a Change Request decision and must not be done implicitly.
215
223
  - Batch policy (no argument):
216
224
  - Contracts-first/Outline: once per batch.
@@ -226,7 +234,7 @@ Rules:
226
234
  - Always write `.qfai/report/preflight_summary.md` before generating shared/spec artifacts.
227
235
  - Contracts are contract-first mandatory outputs in this skill:
228
236
  - 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`)
237
+ - `_policies/05_Contracts.md` must include a Contract Index with short IDs (`DB-001`, `API-001`, `UI-001`)
230
238
  - every indexed short ID must map to a declared file with `QFAI-CONTRACT-ID`:
231
239
  - `DB-001 -> CON-DB-0001 -> db-0001-<slug>.sql`
232
240
  - `API-001 -> CON-API-0001 -> api-0001-<slug>.yaml`
@@ -238,7 +246,7 @@ Rules:
238
246
  - `/qfai-sdd` must stop when discussion-pack is missing/incomplete or has blocking OQ (guide to `/qfai-discussion` first).
239
247
  - Review roster is fixed by `.qfai/assistant/steering/review-roster.yml` and must be executed in full.
240
248
  - RCP wording must be sourced from `.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md`.
241
- - `_shared/04_Business-Flow.md` must be Markdown and include at least one Mermaid `flowchart` or `sequenceDiagram`.
249
+ - `_policies/04_Business-Flow.md` must be Markdown and include at least one Mermaid `flowchart` or `sequenceDiagram`.
242
250
  - Business Flow must not be authored as Gherkin (`*Business-flow*.feature` is deprecated).
243
251
  - If diagrams are written in discuss/require/spec/evidence artifacts, Mermaid syntax must be inside ` ```mermaid ` fences only.
244
252
  - `05_Examples.md` must include `EX-ID` and `BR-Ref` mappings.
@@ -266,12 +274,12 @@ Create/update:
266
274
  - `.qfai/contracts/api/**`
267
275
  - `.qfai/contracts/db/**`
268
276
  - `.qfai/contracts/ui/**`
269
- - `_shared/05_Contracts.md` Contract Index table (DB/API/UI short IDs)
277
+ - `_policies/05_Contracts.md` Contract Index table (DB/API/UI short IDs)
270
278
 
271
279
  Rules:
272
280
 
273
281
  - This phase MUST complete before Outline/Slice.
274
- - If `_shared/05_Contracts.md` lists an ID, the corresponding declared contract file MUST exist.
282
+ - If `_policies/05_Contracts.md` lists an ID, the corresponding declared contract file MUST exist.
275
283
  - If a contract is empty, create a valid minimal stub and include `QFAI-CONTRACT-ID`.
276
284
  - `none` is allowed only when there is no contract impact and rationale is written.
277
285
 
@@ -279,22 +287,22 @@ Rules:
279
287
 
280
288
  Create/update:
281
289
 
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`
290
+ - `_policies/01_Objective.md`
291
+ - `_policies/02_Initiative.md`
292
+ - `_policies/03_Capabilities.md`
293
+ - `_policies/04_Business-Flow.md`
294
+ - `_policies/05_Contracts.md`
295
+ - `_policies/06_Glossary.md`
296
+ - `_policies/07_Constraints.md`
297
+ - `_policies/08_Decisions.md`
298
+ - `_policies/09_Open-questions.md`
299
+ - `_policies/10_delta.md`
292
300
 
293
301
  Rules:
294
302
 
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`.
303
+ - Temporary `TBD` is allowed, but each `TBD` must be mirrored into `_policies/09_Open-questions.md`.
304
+ - `_policies/04_Business-Flow.md` must include Mermaid and keep diagram syntax inside ` ```mermaid ` fences.
305
+ - `_policies/08_Decisions.md` and `_policies/10_delta.md` must exist even when empty, and must explicitly state `0 items`.
298
306
 
299
307
  ### Phase 2 - Slice (slice-first)
300
308
 
@@ -316,6 +324,7 @@ Slice gate (must pass before Phase 3):
316
324
  - For each TC, EX reference must exist.
317
325
  - `SC` tags must align with the target `spec-XXXX` namespace.
318
326
  - `07_Decisions.md` and `08_Open-questions.md` must exist even when empty and include explicit `0 items` statements.
327
+ - `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
328
 
320
329
  ### Phase 3 - Plan finalize
321
330
 
@@ -366,16 +375,16 @@ Create or update layered SDD artifacts in one run so downstream execution phases
366
375
 
367
376
  ## Mandatory Outputs
368
377
 
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`
378
+ - `.qfai/specs/_policies/01_Objective.md`
379
+ - `.qfai/specs/_policies/02_Initiative.md`
380
+ - `.qfai/specs/_policies/03_Capabilities.md`
381
+ - `.qfai/specs/_policies/04_Business-Flow.md`
382
+ - `.qfai/specs/_policies/05_Contracts.md`
383
+ - `.qfai/specs/_policies/06_Glossary.md`
384
+ - `.qfai/specs/_policies/07_Constraints.md`
385
+ - `.qfai/specs/_policies/08_Decisions.md`
386
+ - `.qfai/specs/_policies/09_Open-questions.md`
387
+ - `.qfai/specs/_policies/10_delta.md`
379
388
  - `.qfai/specs/spec-XXXX/01_Spec.md`
380
389
  - `.qfai/specs/spec-XXXX/02_User-stories.md`
381
390
  - `.qfai/specs/spec-XXXX/03_Acceptance-Criteria.md`
@@ -396,7 +405,7 @@ Create or update layered SDD artifacts in one run so downstream execution phases
396
405
  2. If readiness checks fail, stop and show blockers with `/qfai-discussion`.
397
406
  3. Analyze repository context, existing artifacts, constraints, and open decisions.
398
407
  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.
408
+ 5. Execute Phase 0 (Contracts-first) and ensure `_policies/05_Contracts.md` index and `.qfai/contracts/**` are aligned.
400
409
  6. Execute Phase 1 (Outline) in layer-first order.
401
410
  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
411
  8. Execute Phase 3 (Plan finalize) and make every target `10_Plan.md` actionable as How-only.
@@ -410,8 +419,9 @@ Create or update layered SDD artifacts in one run so downstream execution phases
410
419
 
411
420
  Run static checks:
412
421
 
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`.
422
+ - Confirm required `_policies` and `spec-XXXX` layered files exist.
423
+ - Confirm `_policies/04_Business-Flow.md` includes Mermaid and at least one `flowchart` or `sequenceDiagram`.
424
+ - Confirm `01_Spec.md` includes copy-down context and Escalation Hook to `_policies`.
415
425
  - Confirm Mermaid syntax is not written in ` ```text ` or language-less fences.
416
426
  - Confirm `05_Examples.md` provides `EX-ID` + `BR-Ref` mappings.
417
427
  - Confirm `06_Test-Cases.md` provides `TC-ID` + `EX-Ref` + `AC-Refs`.
@@ -457,11 +467,11 @@ When declaring DONE, include:
457
467
  - [ ] CRITICAL CONSTRAINTS were followed.
458
468
  - [ ] `.qfai/report/preflight_summary.md` was generated before spec authoring.
459
469
  - [ ] Contracts-first -> Outline -> Slice -> Plan finalize -> Delta update order was preserved.
460
- - [ ] `_shared/05_Contracts.md` index and `.qfai/contracts/**` declared files are aligned.
470
+ - [ ] `_policies/05_Contracts.md` index and `.qfai/contracts/**` declared files are aligned.
461
471
  - [ ] Upper-to-lower references were not introduced.
462
472
  - [ ] 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`).
473
+ - [ ] Required `_policies` + `spec-XXXX` outputs exist and are internally consistent.
474
+ - [ ] `_policies/04_Business-Flow.md` is Markdown + Mermaid (`flowchart` or `sequenceDiagram`).
465
475
  - [ ] Mermaid syntax was not written in ` ```text ` or language-less fences.
466
476
  - [ ] `10_Plan.md` is finalized with implementation/test strategy (How-only).
467
477
  - [ ] `specs/plan.md` was not created.
@@ -493,6 +503,6 @@ When this skill is complete, provide a final user-facing completion message and
493
503
  - Test-first path: `/qfai-atdd`.
494
504
  Action: implement acceptance tests from the finalized spec pack.
495
505
  - Contracts status:
496
- Action: confirm contracts were created/updated under `.qfai/contracts/**` and referenced by `_shared/05_Contracts.md`.
506
+ Action: confirm contracts were created/updated under `.qfai/contracts/**` and referenced by `_policies/05_Contracts.md`.
497
507
  - Spec pack needs correction: rerun `/qfai-sdd`.
498
- Action: fix layered `_shared + spec-XXXX` consistency and decision records, then regenerate evidence.
508
+ Action: fix layered `_policies + spec-XXXX` consistency and decision records, then regenerate evidence.
@@ -16,4 +16,4 @@
16
16
 
17
17
  ## Next Commands
18
18
 
19
- - /qfai-discussion
19
+ - /qfai-sdd