qfai 1.4.8 → 1.4.18

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 (98) hide show
  1. package/README.md +52 -25
  2. package/assets/init/.qfai/README.md +25 -11
  3. package/assets/init/.qfai/assistant/agents/architect.md +3 -2
  4. package/assets/init/.qfai/assistant/agents/contract-designer.md +3 -2
  5. package/assets/init/.qfai/assistant/agents/design-owner.md +3 -2
  6. package/assets/init/.qfai/assistant/agents/facilitator.md +3 -2
  7. package/assets/init/.qfai/assistant/agents/interviewer.md +3 -2
  8. package/assets/init/.qfai/assistant/agents/option-explorer.md +3 -2
  9. package/assets/init/.qfai/assistant/agents/oq-harvester.md +3 -2
  10. package/assets/init/.qfai/assistant/agents/oq-reviewer.md +3 -2
  11. package/assets/init/.qfai/assistant/agents/planner.md +3 -2
  12. package/assets/init/.qfai/assistant/agents/project-lead.md +3 -2
  13. package/assets/init/.qfai/assistant/agents/requirements-analyst.md +3 -2
  14. package/assets/init/.qfai/assistant/instructions/requirements-decomposition.md +34 -50
  15. package/assets/init/.qfai/assistant/instructions/workflow.md +7 -6
  16. package/assets/init/.qfai/assistant/skills/qfai-discuss/SKILL.md +54 -14
  17. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/00_Summary.md +6 -6
  18. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/04_Business-flow.md +27 -17
  19. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/review/Rxx_reviewer.md +23 -0
  20. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/review/review_request.md +33 -0
  21. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/review/summary.json +50 -0
  22. package/assets/init/.qfai/assistant/skills/qfai-require/SKILL.md +88 -100
  23. package/assets/init/.qfai/assistant/skills/qfai-require/templates/01_sources.md +13 -0
  24. package/assets/init/.qfai/assistant/skills/qfai-require/templates/02_requirement-index.md +28 -0
  25. package/assets/init/.qfai/assistant/skills/qfai-require/templates/03_open-questions.md +13 -0
  26. package/assets/init/.qfai/assistant/skills/qfai-require/templates/review/Rxx_reviewer.md +23 -0
  27. package/assets/init/.qfai/assistant/skills/qfai-require/templates/review/review_request.md +33 -0
  28. package/assets/init/.qfai/assistant/skills/qfai-require/templates/review/summary.json +50 -0
  29. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +103 -65
  30. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/evidence/import-lite.md +28 -0
  31. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/report/preflight_summary.md +26 -0
  32. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/spec-pack/03_Initiative.md +4 -3
  33. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/spec-pack/08_Business-rules.md +29 -7
  34. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/spec-pack/09_Examples.feature +13 -1
  35. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/spec-pack/10_Test-cases.md +31 -0
  36. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_shared/03_Capabilities.md +19 -0
  37. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_shared/04_Business-flow.md +38 -0
  38. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_shared/05_Contracts.md +26 -0
  39. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/01_Spec.md +15 -0
  40. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/02_User-stories.md +12 -0
  41. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/03_Acceptance-criteria.md +13 -0
  42. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/04_Business-rules.md +13 -0
  43. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/05_Examples.feature +9 -0
  44. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/06_Test-cases.md +13 -0
  45. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/07_Decisions.md +7 -0
  46. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/08_Open-questions.md +9 -0
  47. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/09_delta.md +16 -0
  48. package/assets/init/.qfai/assistant/skills/qfai-sdd-planning/SKILL.md +206 -0
  49. package/assets/init/.qfai/assistant/skills/qfai-sdd-planning/templates/evidence/import-lite.md +28 -0
  50. package/assets/init/.qfai/assistant/skills/qfai-sdd-planning/templates/report/preflight_summary.md +26 -0
  51. package/assets/init/.qfai/assistant/skills/qfai-sdd-planning/templates/review/Rxx_reviewer.md +29 -0
  52. package/assets/init/.qfai/assistant/skills/qfai-sdd-planning/templates/review/review_request.md +39 -0
  53. package/assets/init/.qfai/assistant/skills/qfai-sdd-planning/templates/review/summary.json +50 -0
  54. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/SKILL.md +257 -0
  55. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/evidence/import-lite.md +28 -0
  56. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/report/preflight_summary.md +26 -0
  57. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/review/Rxx_reviewer.md +29 -0
  58. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/review/review_request.md +39 -0
  59. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/review/summary.json +50 -0
  60. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/_shared/03_Capabilities.md +19 -0
  61. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/_shared/04_Business-flow.md +38 -0
  62. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/_shared/05_Contracts.md +26 -0
  63. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/01_Spec.md +15 -0
  64. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/02_User-stories.md +12 -0
  65. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/03_Acceptance-criteria.md +13 -0
  66. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/04_Business-rules.md +13 -0
  67. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/05_Examples.feature +9 -0
  68. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/06_Test-cases.md +13 -0
  69. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/07_Decisions.md +7 -0
  70. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/08_Open-questions.md +9 -0
  71. package/assets/init/.qfai/assistant/skills/qfai-sdd-refinement/templates/specs/spec/09_delta.md +16 -0
  72. package/assets/init/.qfai/assistant/steering/review-gate.rules.yml +57 -0
  73. package/assets/init/.qfai/discuss/README.md +9 -4
  74. package/assets/init/.qfai/report/README.md +19 -0
  75. package/assets/init/.qfai/require/README.md +31 -33
  76. package/assets/init/.qfai/review/README.md +31 -0
  77. package/assets/init/.qfai/specs/README.md +62 -38
  78. package/assets/init/.qfai/status/.gitignore +3 -0
  79. package/assets/init/.qfai/status/README.md +30 -0
  80. package/dist/cli/index.cjs +5166 -1448
  81. package/dist/cli/index.cjs.map +1 -1
  82. package/dist/cli/index.mjs +5170 -1452
  83. package/dist/cli/index.mjs.map +1 -1
  84. package/dist/index.cjs +6166 -3336
  85. package/dist/index.cjs.map +1 -1
  86. package/dist/index.d.cts +32 -2
  87. package/dist/index.d.ts +32 -2
  88. package/dist/index.mjs +6161 -3338
  89. package/dist/index.mjs.map +1 -1
  90. package/package.json +1 -1
  91. package/assets/init/.qfai/assistant/skills/qfai-require/templates/00_Summary.md +0 -37
  92. package/assets/init/.qfai/assistant/skills/qfai-require/templates/01_Functional-requirements.md +0 -16
  93. package/assets/init/.qfai/assistant/skills/qfai-require/templates/02_Non-functional-requirements.md +0 -15
  94. package/assets/init/.qfai/assistant/skills/qfai-require/templates/03_Contracts-boundary.md +0 -19
  95. package/assets/init/.qfai/assistant/skills/qfai-require/templates/04_Data-and-glossary.md +0 -16
  96. package/assets/init/.qfai/assistant/skills/qfai-require/templates/05_Test-policy.md +0 -18
  97. package/assets/init/.qfai/assistant/skills/qfai-require/templates/06_Compliance-and-risk.md +0 -18
  98. package/assets/init/.qfai/assistant/skills/qfai-require/templates/07_Open-questions.md +0 -18
package/README.md CHANGED
@@ -31,9 +31,9 @@ npx qfai report
31
31
  ## What you can do (CLI commands)
32
32
 
33
33
  - `npx qfai init`
34
- - Creates the QFAI workspace under `.qfai/` (requirements/specs/contracts/report) and installs the AI assistant kit (`assistant/` with skills, instructions, agents, and steering templates), plus `qfai.config.yaml`.
34
+ - Creates the QFAI workspace under `.qfai/` (requirements/specs/status/contracts/report) and installs the AI assistant kit (`assistant/` with skills, instructions, agents, and steering templates), plus `qfai.config.yaml`.
35
35
  - `npx qfai validate`
36
- - Validates specs/contracts/scenarios/traceability and writes `.qfai/report/validate.json`; use `--fail-on error` (or `--fail-on warning`) to turn it into a CI gate, and `--format github` to emit GitHub-friendly annotations. Use `--phase refinement` only for local refinement checks; CI should use default/full validation.
36
+ - Validates specs/contracts/scenarios/traceability and review gate artifacts (`.qfai/review/**/summary.json`), then writes `.qfai/report/validate.json`; use `--fail-on error` (or `--fail-on warning`) to turn it into a CI gate, and `--format github` to emit GitHub-friendly annotations. Use `--phase refinement` only for local refinement checks; CI should use default/full validation.
37
37
  - `npx qfai report`
38
38
  - Produces a human-readable report (`report.md` by default) or an internal JSON export (`report.json`) from `validate.json`; use `--base-url` to link file paths in Markdown to your repository viewer.
39
39
  - `npx qfai doctor`
@@ -56,8 +56,10 @@ QFAI includes a small set of custom skills (stored under `.qfai/assistant/skills
56
56
 
57
57
  - **qfai-configure**: Analyze the repository (language, frameworks, test layout, directory structure) and tailor `qfai.config.yaml` accordingly (especially `testFileGlobs`). Run this once right after `npx qfai init`, and re-run it when the repository structure changes.
58
58
  - **qfai-discuss**: Turn an idea into clear requirements by discussing scope, constraints, risks, and open questions.
59
- - **qfai-require**: Produce `.qfai/require/REQUIRE-XXXX/*` from your idea or discussion output.
60
- - **qfai-sdd**: Produce/update the full spec pack (`01_Spec.md` to `18_delta.md`) in one workflow (Outline -> Slice -> Plan finalize -> Delta).
59
+ - **qfai-require**: Produce `01_sources.md`, `02_requirement-index.md`, and `03_open-questions.md` under `.qfai/require/require-<ts>/` from your idea or discussion output.
60
+ - **qfai-sdd**: Unified SDD entrypoint with preflight mode selection (`specs-first` / `require-indexed` / `import-lite` / `interview-start`).
61
+ - **qfai-sdd-refinement**: Build `_shared` + `spec-XXXX/01..06` from the selected preflight mode.
62
+ - **qfai-sdd-planning**: Finalize `plan.md` and `spec-XXXX/10_Plan`; if specs are missing, redirect to refinement.
61
63
  - **qfai-prototyping**: Build a contract-aligned skeleton implementation before deep coding.
62
64
  - **qfai-atdd**: Implement acceptance tests driven by specs/scenarios.
63
65
  - **qfai-tdd-red**: Add failing unit/component tests from the approved acceptance scenarios.
@@ -87,18 +89,23 @@ AG-->>U: Config tuned to this repo
87
89
 
88
90
  opt If you only have an idea
89
91
  U->>AG: Run /qfai-discuss
90
- AG-->>U: Structured discuss package (.qfai/discuss/DISCUSS-XXXX/)
92
+ AG-->>U: Structured discuss package (.qfai/discuss/discuss-<ts>/)
91
93
  end
92
94
 
93
95
  U->>AG: Run /qfai-require
94
96
  AG->>Q: Read .qfai/assistant/skills/qfai-require/SKILL.md
95
- AG->>R: Create/Update REQUIRE-XXXX package docs
96
- AG-->>U: Requirement package ready
97
+ AG->>R: Create/Update require index docs under require-<ts> (01_sources/02_requirement-index/03_open-questions)
98
+ AG-->>U: Requirement index ready
97
99
 
98
- U->>AG: Run /qfai-sdd
99
- AG->>Q: Read .qfai/assistant/skills/qfai-sdd/SKILL.md
100
- AG->>R: Create/refine spec pack (01..18) + contracts + 17_Plan.md
101
- AG-->>U: SDD artifacts ready
100
+ U->>AG: Run /qfai-sdd-refinement (or /qfai-sdd)
101
+ AG->>Q: Read .qfai/assistant/skills/qfai-sdd-refinement/SKILL.md
102
+ AG->>R: Preflight + create/refine _shared + spec-XXXX/01..06
103
+ AG-->>U: Refinement artifacts ready
104
+
105
+ U->>AG: Run /qfai-sdd-planning
106
+ AG->>Q: Read .qfai/assistant/skills/qfai-sdd-planning/SKILL.md
107
+ AG->>R: Finalize plan.md + spec-XXXX/10_Plan (+ delta updates)
108
+ AG-->>U: Planning artifacts ready
102
109
 
103
110
  U->>AG: Run /qfai-prototyping
104
111
  AG->>Q: Read .qfai/assistant/skills/qfai-prototyping/SKILL.md
@@ -146,6 +153,7 @@ Operational notes.
146
153
  - Skills should delegate work to multiple role-based sub-agents (Planner, Architect, Contract Designer, QA, Code Reviewer, etc.) to emulate a real delivery flow.
147
154
  - Change classification (Primary/Tags) is required in `18_delta.md` and recommended in PRs. See `.qfai/assistant/instructions/change-classification.md`.
148
155
  - Verification planning is recorded in `18_delta.md` (`Verification -> Plan`) and validated in CI (`VFY-*` rules).
156
+ - Review gate policies (required/optional layers and reviewers) are defined in `.qfai/assistant/steering/review-gate.rules.yml`.
149
157
 
150
158
  ## Configuration
151
159
 
@@ -207,18 +215,19 @@ flowchart LR
207
215
  - Contracts SSOT: `.qfai/contracts/**`
208
216
  - Report outputs (`.qfai/report/**`) are derived artifacts and not SSOT.
209
217
 
210
- ## Minimal tutorial (v1.4.8)
218
+ ## Minimal tutorial (v1.4.18)
211
219
 
212
220
  1. `npx qfai init`
213
221
  2. Run `/qfai-discuss` to structure scope and open questions.
214
- 3. Run `/qfai-require` to produce `REQUIRE-XXXX`.
215
- 4. Run `/qfai-sdd` to build `spec-XXXX/01..18`.
216
- 5. Run `npx qfai validate` then `npx qfai report`.
222
+ 3. Run `/qfai-require` to produce require index files (`01_sources`, `02_requirement-index`, `03_open-questions`) under `.qfai/require/require-<ts>/`.
223
+ 4. Run `/qfai-sdd` (or `/qfai-sdd-refinement` -> `/qfai-sdd-planning`) to build layered specs and finalized plans.
224
+ 5. For each completed layer gate, generate review artifacts under `.qfai/review/<scope>/<layer>/attempt-<NN>/`.
225
+ 6. Run `npx qfai validate` then `npx qfai report`.
217
226
 
218
227
  Release gate behavior:
219
228
 
220
229
  - Merge gate: `qfai validate` must pass (`error=0`), and open OQ is warning.
221
- - Release gate: set `release_candidate: true` in `03_Initiative.md`; open OQ then becomes error.
230
+ - Release gate: set `release_candidate: true` in `.qfai/status/*.json` (for example, `release.json`); open OQ then becomes error.
222
231
 
223
232
  ## FAQ
224
233
 
@@ -229,11 +238,13 @@ Release gate behavior:
229
238
  - Q: `18_delta.md` fails validation.
230
239
  - A: Include all required sections (`Change Summary`, `Rationale`, `Candidates Considered`, `Adopted`, `Rejected`, `Impact`, `Follow-ups`) and include both `DO NOT` and `Temptation` in `Rejected`.
231
240
  - Q: release_candidate validation fails due open questions.
232
- - A: In `15_Open-questions.md`, change `status: open` to `resolved` or `deferred` and keep evidence.
241
+ - A: Keep specs definition-only, then update status in `.qfai/status/*.json` and convert open OQ to `resolved` or `deferred` with evidence.
233
242
 
234
243
  ## Continuous integration
235
244
 
236
- QFAI v1.4.8 no longer generates `.github/**` assets.
245
+ QFAI v1.4.18 generates `.github/**` only for Copilot integration wrappers
246
+ (`.github/prompts`, `.github/agents`).
247
+ It does not generate GitHub Actions workflows.
237
248
  Configure CI in your own platform and run:
238
249
 
239
250
  ```bash
@@ -301,6 +312,10 @@ Typical customizations.
301
312
  │ │ │ │ └── SKILL.md
302
313
  │ │ │ ├── qfai-sdd
303
314
  │ │ │ │ └── SKILL.md
315
+ │ │ │ ├── qfai-sdd-refinement
316
+ │ │ │ │ └── SKILL.md
317
+ │ │ │ ├── qfai-sdd-planning
318
+ │ │ │ │ └── SKILL.md
304
319
  │ │ │ ├── qfai-atdd
305
320
  │ │ │ │ └── SKILL.md
306
321
  │ │ │ ├── qfai-tdd-red
@@ -315,13 +330,14 @@ Typical customizations.
315
330
  │ │ │ └── README.md
316
331
  │ │ ├── steering
317
332
  │ │ │ ├── README.md
333
+ │ │ │ ├── review-gate.rules.yml
318
334
  │ │ │ ├── product.md
319
335
  │ │ │ ├── structure.md
320
336
  │ │ │ └── tech.md
321
337
  │ │ └── README.md
322
338
  │ ├── discuss
323
339
  │ │ ├── README.md
324
- │ │ └── DISCUSS-0001
340
+ │ │ └── discuss-20260215205220203
325
341
  │ │ ├── 00_Summary.md
326
342
  │ │ ├── ...
327
343
  │ │ └── 07_Open-questions.md
@@ -337,10 +353,14 @@ Typical customizations.
337
353
  │ │ └── README.md
338
354
  │ ├── require
339
355
  │ │ ├── README.md
340
- │ │ ├── REQUIRE-0001
341
- │ │├── 00_Summary.md
342
- │ │├── ...
343
- │ │└── 07_Open-questions.md
356
+ │ │ └── require-20260215205220203
357
+ │ │ ├── 01_sources.md
358
+ │ │ ├── 02_requirement-index.md
359
+ │ │ └── 03_open-questions.md
360
+ │ ├── review
361
+ │ │ └── README.md
362
+ │ ├── status
363
+ │ │ ├── .gitignore
344
364
  │ │ └── README.md
345
365
  │ ├── specs
346
366
  │ │ └── README.md
@@ -348,10 +368,17 @@ Typical customizations.
348
368
  └── qfai.config.yaml
349
369
  ```
350
370
 
371
+ Integration wrappers are also generated for immediate use:
372
+
373
+ - Claude Code: `.claude/commands/**`, `.claude/agents/**`
374
+ - GitHub Copilot: `.github/prompts/**`, `.github/agents/**`
375
+ - Codex: `.codex/skills/**`
376
+
351
377
  ## Agent integrations
352
378
 
353
- `npx qfai init` installs only canonical skills under `.qfai/assistant/skills/**`.
354
- If your toolchain needs wrapper files, manage them in your own repository convention and keep `.qfai/assistant/skills/**` as SSOT.
379
+ `npx qfai init` installs canonical skills under `.qfai/assistant/skills/**` (SSOT)
380
+ and generates thin wrapper assets for Copilot / Claude Code / Codex.
381
+ If wrapper assets drift from canonical skills, rerun `npx qfai init --force` to resync.
355
382
 
356
383
  ## Contributing (for QFAI maintainers)
357
384
 
@@ -15,12 +15,13 @@ This folder is generated by `qfai init` and designed to be:
15
15
  ```mermaid
16
16
  flowchart TD
17
17
  A[/qfai-discuss/] --> B[/qfai-require/]
18
- B --> C[/qfai-sdd/]
19
- C --> D[/qfai-prototyping/]
20
- D --> E[/qfai-atdd/]
21
- E --> F[/qfai-tdd-red/]
22
- F --> G[/qfai-tdd-green/]
23
- G --> H[/qfai-tdd-refactor/]
18
+ B --> C[/qfai-sdd-refinement/]
19
+ C --> D[/qfai-sdd-planning/]
20
+ D --> E[/qfai-prototyping/]
21
+ E --> F[/qfai-atdd/]
22
+ F --> G[/qfai-tdd-red/]
23
+ G --> H[/qfai-tdd-green/]
24
+ H --> I[/qfai-tdd-refactor/]
24
25
  ```
25
26
 
26
27
  > Formatting must follow the templates and checklists documented in each directory README.
@@ -39,7 +40,18 @@ flowchart TD
39
40
  │ ├── steering/ # project steering inputs
40
41
  │ └── instructions/ # workflow and guardrail docs
41
42
  ├── require/
43
+ │ ├── README.md
44
+ │ └── require-YYYYMMDDhhmmssSSS/
45
+ │ ├── 01_sources.md
46
+ │ ├── 02_requirement-index.md
47
+ │ └── 03_open-questions.md
48
+ ├── report/
49
+ │ └── README.md
50
+ ├── review/
42
51
  │ └── README.md
52
+ ├── status/
53
+ │ ├── README.md
54
+ │ └── .gitignore
43
55
  ├── contracts/
44
56
  │ ├── README.md
45
57
  │ ├── api/
@@ -79,15 +91,16 @@ It is useful for local review but should not pollute version control.
79
91
  - Prefer small stable identifiers (REQ/BR/AC/TC/EX/etc.) over long mixed paragraphs.
80
92
  - If one line contains multiple independent constraints, split it.
81
93
 
82
- ### R4. Spec Pack 01..18 is runtime SSOT
94
+ ### R4. Layered specs are runtime SSOT
83
95
 
84
- - Runtime validators and downstream skills consume `01_*` to `18_*`.
85
- - Traceability links are written in `16_Traceability-ledger.md`.
96
+ - Runtime validators and downstream skills consume `_shared/**` and `spec-XXXX/**`.
97
+ - Split rule is fixed: `1 CAP = 1 spec`.
98
+ - Parent chain is fixed: `US -> CAP`, `AC -> US`, `BR -> AC`, `EX -> BR|AC`, `TC -> EX`.
86
99
  - Derived outputs under `.qfai/report/**` are non-SSOT.
87
100
 
88
101
  ### R5. init is an empty scaffold
89
102
 
90
- - `qfai init` creates README-centric directories for `discuss`, `require`, `contracts`, and `specs`.
103
+ - `qfai init` creates README-centric directories for `discuss`, `require`, `report`, `status`, `contracts`, and `specs`.
91
104
  - Sample artifacts are provided under skill templates (for example, `assistant/skills/qfai-sdd/templates/contracts/`).
92
105
 
93
106
  ## Skills (SSOT)
@@ -98,7 +111,8 @@ Invoke canonical skills from this tree directly.
98
111
  ## Where to look next
99
112
 
100
113
  - Requirements format: `require/README.md`
114
+ - Review gate format: `review/README.md`
101
115
  - Contracts format: `contracts/README.md` and child READMEs
102
- - Spec pack format: `specs/README.md`
116
+ - Layered spec format: `specs/README.md`
103
117
  - Change classification: `assistant/instructions/change-classification.md`
104
118
  - Evidence rules: `evidence/README.md`
@@ -11,8 +11,9 @@
11
11
  - .qfai/assistant/steering/\*
12
12
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
13
13
  - .qfai/specs/spec-\*/spec.md
14
- - .qfai/require/REQUIRE-XXXX/\* (preferred)
15
- - .qfai/require/require.md (legacy compatibility)
14
+ - .qfai/require/require-\*/01_sources.md
15
+ - .qfai/require/require-\*/02_requirement-index.md
16
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
16
17
  - Existing architecture docs (if any)
17
18
 
18
19
  ## Deliverables (MANDATORY)
@@ -11,8 +11,9 @@
11
11
  - .qfai/assistant/steering/\*
12
12
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
13
13
  - .qfai/specs/spec-\*/spec.md
14
- - .qfai/require/REQUIRE-XXXX/\* (preferred)
15
- - .qfai/require/require.md (legacy compatibility)
14
+ - .qfai/require/require-\*/01_sources.md
15
+ - .qfai/require/require-\*/02_requirement-index.md
16
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
16
17
  - Existing contracts under `.qfai/contracts/**`
17
18
 
18
19
  ## Deliverables (MANDATORY)
@@ -10,8 +10,9 @@
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
12
  - .qfai/specs/spec-\*/spec.md
13
- - .qfai/require/REQUIRE-XXXX/\* (preferred)
14
- - .qfai/require/require.md (legacy compatibility)
13
+ - .qfai/require/require-\*/01_sources.md
14
+ - .qfai/require/require-\*/02_requirement-index.md
15
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
15
16
  - Evidence summaries under `.qfai/evidence/` (gitignored)
16
17
 
17
18
  ## Deliverables (MANDATORY)
@@ -11,8 +11,9 @@
11
11
  - .qfai/assistant/steering/\*
12
12
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
13
13
  - Existing discussion records under `.qfai/discuss/`
14
- - .qfai/require/REQUIRE-XXXX/\* (preferred if present)
15
- - .qfai/require/require.md (legacy compatibility)
14
+ - .qfai/require/require-\*/01_sources.md
15
+ - .qfai/require/require-\*/02_requirement-index.md
16
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
16
17
 
17
18
  ## Deliverables (MANDATORY)
18
19
 
@@ -10,8 +10,9 @@
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
12
  - Existing discussion records under `.qfai/discuss/`
13
- - .qfai/require/REQUIRE-XXXX/\* (preferred if present)
14
- - .qfai/require/require.md (legacy compatibility)
13
+ - .qfai/require/require-\*/01_sources.md
14
+ - .qfai/require/require-\*/02_requirement-index.md
15
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
15
16
 
16
17
  ## Deliverables (MANDATORY)
17
18
 
@@ -9,8 +9,9 @@
9
9
  - .qfai/assistant/instructions/\*
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/require/REQUIRE-XXXX/\* (preferred if present)
13
- - .qfai/require/require.md (legacy compatibility)
12
+ - .qfai/require/require-\*/01_sources.md
13
+ - .qfai/require/require-\*/02_requirement-index.md
14
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
14
15
  - .qfai/specs/spec-\*/spec.md
15
16
  - .qfai/specs/spec-\*/delta.md (draft)
16
17
  - .qfai/contracts/\*\*
@@ -9,8 +9,9 @@
9
9
  - .qfai/assistant/instructions/\*
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/require/REQUIRE-XXXX/\* (preferred if present)
13
- - .qfai/require/require.md (legacy compatibility)
12
+ - .qfai/require/require-\*/01_sources.md
13
+ - .qfai/require/require-\*/02_requirement-index.md
14
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
14
15
  - .qfai/require/open-questions.md (if present)
15
16
  - .qfai/specs/spec-\*/spec.md
16
17
  - .qfai/specs/spec-\*/delta.md
@@ -12,8 +12,9 @@
12
12
  - .qfai/assistant/steering/test-layers.md (test-layer definitions + required coverage expectations)
13
13
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
14
14
  - OQ candidate list from OQ Harvester
15
- - .qfai/require/REQUIRE-XXXX/\* (preferred if present)
16
- - .qfai/require/require.md (legacy compatibility)
15
+ - .qfai/require/require-\*/01_sources.md
16
+ - .qfai/require/require-\*/02_requirement-index.md
17
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
17
18
  - .qfai/require/open-questions.md (if present)
18
19
  - .qfai/specs/spec-\*/spec.md
19
20
  - .qfai/specs/spec-\*/delta.md
@@ -10,8 +10,9 @@
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
12
  - .qfai/specs/spec-\*/spec.md
13
- - .qfai/require/REQUIRE-XXXX/\* (preferred)
14
- - .qfai/require/require.md (legacy compatibility)
13
+ - .qfai/require/require-\*/01_sources.md
14
+ - .qfai/require/require-\*/02_requirement-index.md
15
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
15
16
  - Existing constraints and gate commands
16
17
 
17
18
  ## Deliverables (MANDATORY)
@@ -9,8 +9,9 @@
9
9
  - .qfai/assistant/instructions/\*
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/require/REQUIRE-XXXX/\* (preferred)
13
- - .qfai/require/require.md (legacy compatibility)
12
+ - .qfai/require/require-\*/01_sources.md
13
+ - .qfai/require/require-\*/02_requirement-index.md
14
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
14
15
  - .qfai/specs/spec-\*/spec.md
15
16
  - Evidence summaries under `.qfai/evidence/` (gitignored)
16
17
 
@@ -9,8 +9,9 @@
9
9
  - .qfai/assistant/instructions/\*
10
10
  - .qfai/assistant/steering/\*
11
11
  - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/require/REQUIRE-XXXX/\* (preferred if present)
13
- - .qfai/require/require.md (legacy compatibility)
12
+ - .qfai/require/require-\*/01_sources.md
13
+ - .qfai/require/require-\*/02_requirement-index.md
14
+ - .qfai/require/require-\*/03_open-questions.md (input gaps ledger)
14
15
  - Discussion records under `.qfai/discuss/`
15
16
  - .qfai/specs/spec-\*/spec.md (if available)
16
17
 
@@ -2,74 +2,58 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Define a **repeatable decomposition** from top-level domain context to requirements, specs, and tests.
5
+ Define a repeatable decomposition from external requirement sources to layered specs and tests.
6
6
 
7
- This document is the **decision rule SSOT** for AI and humans when answering:
7
+ This document is the decision rule SSOT for AI and humans when answering:
8
8
 
9
- - "What is the top-level structure?"
10
- - "How do we break down work into spec packs?"
11
- - "How do we keep traceability stable?"
9
+ - What inputs are required before SDD starts?
10
+ - How should capabilities be split into spec directories?
11
+ - How is traceability kept stable?
12
12
 
13
13
  ## Canonical order (top -> down)
14
14
 
15
- 1. **Glossary** (`require/glossary.md`)
16
- 2. **Actors** (`require/actors.md`)
17
- 3. **Business flows** (`require/business-flows.md`)
18
- 4. **Requirements** (`require/REQUIRE-XXXX/*` preferred, `require/require.md` legacy compatibility)
19
- 5. **Spec packs** (`specs/spec-*/spec.md`, `delta.md`, `scenario.feature`, `case-catalogue.md`, `traceability-matrix.md`)
15
+ 1. **Source registry** (`require/require-*/01_sources.md`)
16
+ 2. **Requirement index** (`require/require-*/02_requirement-index.md`)
17
+ 3. **Input gaps / Open Questions** (`require/require-*/03_open-questions.md`)
18
+ 4. **Shared specs** (`specs/_shared/01..04`)
19
+ 5. **Capability slices** (`specs/spec-*/01..05` minimum)
20
20
  6. **ATDD / TDD** (tests + code)
21
21
 
22
22
  ## Decision rules
23
23
 
24
- ### Rule 1 - Always anchor scope to Business Flow steps
24
+ ### Rule 1 - Start from source-backed inputs
25
25
 
26
- - A spec pack MUST be a slice of **one or more BF steps**.
27
- - If a BF step is in scope, it MUST be covered by:
28
- - a requirement (`REQ-*`) and/or
29
- - a spec pack (`spec-*`) and/or
30
- - an explicit Out-of-scope row in the Coverage Map.
26
+ - Every requirement index row must point to source IDs (`SRC-XXXX`).
27
+ - If source linkage is missing, stop and create an Open Question.
31
28
 
32
- ### Rule 2 - Use actors to remove ambiguity
29
+ ### Rule 2 - Preserve layered ownership
33
30
 
34
- When writing requirements/specs/scenarios, explicitly name:
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/`.
35
34
 
36
- - the primary actor who initiates the interaction
37
- - any supporting actors (external services, humans, systems)
35
+ ### Rule 3 - Keep ambiguity explicit
38
36
 
39
- If an actor is missing, add it to `actors.md` before proceeding.
37
+ - Unknowns remain explicit as Open Questions.
38
+ - Resolved answers are promoted to `_shared` or `spec-XXXX` artifacts, then OQ status is updated.
40
39
 
41
- ### Rule 3 - Keep Glossary small but authoritative
40
+ ## How to decompose (mechanical procedure)
42
41
 
43
- - Add terms only if they reduce ambiguity or avoid inconsistent naming.
44
- - Prefer **one term** with synonyms over multiple near-duplicate terms.
45
- - When a term changes meaning, record the decision in a discussion log.
42
+ 1. Register source documents and assumptions in `require-*/01_sources.md`.
43
+ 2. Extract concise requirement index entries in `require-*/02_requirement-index.md`.
44
+ 3. Capture missing information in `require-*/03_open-questions.md`.
45
+ 4. Build `_shared` layer (`Objective`, `Initiative`, `Capabilities`, `Business Flow`).
46
+ 5. Split by capability (`1 CAP = 1 spec-XXXX`) and produce slice files.
47
+ 6. Derive acceptance tests and implementation from the finalized slices.
46
48
 
47
- ## How to decompose (mechanical procedure)
49
+ ## Example
48
50
 
49
- 1. Draft **Actors** (Primary / Supporting / System).
50
- 2. Draft **Business Flow backbone**:
51
- - 5-15 steps per flow is a useful target.
52
- - Each step should be a verb phrase and observable.
53
- 3. For each in-scope BF step, draft:
54
- - a candidate user story (optional; can remain implicit)
55
- - one or more atomic **REQ-FUNC** items (EARS style recommended)
56
- - any **REQ-NFR** needed for the step
57
- 4. Group BF steps into spec packs:
58
- - Aim for 1-3 scenarios per spec pack.
59
- - Split when scenarios exceed that or when the slice spans multiple distinct user goals.
60
- 5. In each spec pack:
61
- - Reference BF step IDs and actor IDs in `spec.md` Context.
62
- - Ensure traceability matrix includes BF step IDs.
63
-
64
- ## Examples
65
-
66
- ### Example: One BF step -> one spec pack
67
-
68
- - BF step: `BF-0003-S02 User submits validation request`
69
- - Spec pack: `spec-0012`
70
- - Context: Actor `ACT-0001 Developer`
71
- - Traceability: `BF-0003-S02 -> REQ-FUNC-0044 -> spec-0012 -> SC-0012-01`
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`
72
54
 
73
55
  ## Non-goals
74
56
 
75
- - BPMN diagrams are NOT required (text-first). If you add diagrams, they are optional evidence, not SSOT.
57
+ - Managing release status flags in specs.
58
+ - Keeping full requirement prose in `require/`.
59
+ - Treating diagrams as mandatory at require stage.
@@ -49,15 +49,16 @@ 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): `.qfai/specs/spec-XXXX/`
53
- 4. Prototyping (optional): contract-aligned implementation skeleton
54
- 5. Scenario tests (ATDD): runnable scenario tests derived from `scenario.feature`
55
- 6. TDD: red/green/refactor loop enforcing spec + tests
56
- 7. Verify: run quality gates and provide evidence
52
+ 3. Specification refinement (SDD): preflight + `_shared` / `spec-XXXX/01..06`
53
+ 4. Specification planning (SDD): `plan.md` + `spec-XXXX/10_Plan.md`
54
+ 5. Prototyping (optional): contract-aligned implementation skeleton
55
+ 6. Scenario tests (ATDD): runnable scenario tests derived from `scenario.feature`
56
+ 7. TDD: red/green/refactor loop enforcing spec + tests
57
+ 8. Verify: run quality gates and provide evidence
57
58
 
58
59
  ### Stage 0 — Steering refresh contract (mandatory)
59
60
 
60
- At the beginning of each stage (`qfai-discuss`, `qfai-require`, `qfai-sdd`, `qfai-prototyping`, `qfai-atdd`, `qfai-tdd-*`, `qfai-verify`):
61
+ At the beginning of each stage (`qfai-discuss`, `qfai-require`, `qfai-sdd`, `qfai-sdd-refinement`, `qfai-sdd-planning`, `qfai-prototyping`, `qfai-atdd`, `qfai-tdd-*`, `qfai-verify`):
61
62
 
62
63
  1. Check these steering files:
63
64
  - `.qfai/assistant/steering/manifest.md`