qfai 1.4.38 → 1.5.0

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 (65) hide show
  1. package/README.md +30 -28
  2. package/assets/init/.qfai/README.md +1 -2
  3. package/assets/init/.qfai/assistant/instructions/workflow.md +1 -1
  4. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +3 -3
  5. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +331 -0
  6. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +37 -0
  7. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/02_Inception-Deck.md +64 -0
  8. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +44 -0
  9. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/04_Sources.md +18 -0
  10. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/05_Scope.md +29 -0
  11. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/06_REQ.md +19 -0
  12. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/07_NFR.md +22 -0
  13. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/08_Glossary.md +18 -0
  14. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/09_Constraints.md +29 -0
  15. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/10_Policy.md +26 -0
  16. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/11_OQ-Register.md +17 -0
  17. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/12_OQ-Resolution-Log.md +13 -0
  18. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/13_Deferred.md +14 -0
  19. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +47 -0
  20. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/99_delta.md +26 -0
  21. package/assets/init/.qfai/assistant/skills/{qfai-require → qfai-discussion}/templates/review/Rxx_reviewer.md +2 -1
  22. package/assets/init/.qfai/assistant/skills/{qfai-require → qfai-discussion}/templates/review/review_request.md +5 -7
  23. package/assets/init/.qfai/assistant/skills/{qfai-discuss → qfai-discussion}/templates/review/summary.json +3 -3
  24. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +1 -1
  25. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +6 -7
  26. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/report/preflight_summary.md +3 -4
  27. package/assets/init/.qfai/discussion/README.md +105 -0
  28. package/assets/init/.qfai/review/README.md +1 -3
  29. package/assets/init/root/qfai.config.yaml +1 -1
  30. package/dist/cli/index.cjs +901 -1398
  31. package/dist/cli/index.cjs.map +1 -1
  32. package/dist/cli/index.mjs +894 -1395
  33. package/dist/cli/index.mjs.map +1 -1
  34. package/dist/index.cjs +673 -1085
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +2 -2
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.mjs +667 -1083
  39. package/dist/index.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/assets/init/.qfai/assistant/skills/qfai-discuss/SKILL.md +0 -281
  42. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/01_Context.md +0 -27
  43. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/02_Hearing.md +0 -29
  44. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/03_Config-Hearing.md +0 -28
  45. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/04_Deep-Dive.md +0 -21
  46. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/05_OQ-Register.md +0 -15
  47. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/06_OQ-Resolution-Log.md +0 -12
  48. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/07_Deferred.md +0 -13
  49. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/08_Review-Request.md +0 -29
  50. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/09_delta.md +0 -25
  51. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/review/Rxx_reviewer.md +0 -23
  52. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/review/review_request.md +0 -38
  53. package/assets/init/.qfai/assistant/skills/qfai-require/SKILL.md +0 -233
  54. package/assets/init/.qfai/assistant/skills/qfai-require/templates/01_Sources.md +0 -16
  55. package/assets/init/.qfai/assistant/skills/qfai-require/templates/02_Scope.md +0 -17
  56. package/assets/init/.qfai/assistant/skills/qfai-require/templates/03_REQ.md +0 -12
  57. package/assets/init/.qfai/assistant/skills/qfai-require/templates/04_NFR.md +0 -12
  58. package/assets/init/.qfai/assistant/skills/qfai-require/templates/05_Glossary.md +0 -11
  59. package/assets/init/.qfai/assistant/skills/qfai-require/templates/06_Constraints.md +0 -15
  60. package/assets/init/.qfai/assistant/skills/qfai-require/templates/07_Policy.md +0 -12
  61. package/assets/init/.qfai/assistant/skills/qfai-require/templates/08_OQ.md +0 -19
  62. package/assets/init/.qfai/assistant/skills/qfai-require/templates/09_delta.md +0 -18
  63. package/assets/init/.qfai/assistant/skills/qfai-require/templates/review/summary.json +0 -61
  64. package/assets/init/.qfai/discuss/README.md +0 -39
  65. package/assets/init/.qfai/require/README.md +0 -64
package/README.md CHANGED
@@ -31,15 +31,24 @@ 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/contracts/report) and installs the AI assistant kit
35
+ (`assistant/` with skills, instructions, agents, and steering templates), plus `qfai.config.yaml`.
35
36
  - `npx qfai validate`
36
- - Validates specs/contracts/scenarios/traceability and review artifacts (`.qfai/review/review-*/summary.json` + minimum schema), writes `.qfai/report/validate.json`, and appends run logs to `.qfai/report/run-*/`; 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
+ - Validates specs/contracts/scenarios/traceability and review artifacts
38
+ (`.qfai/review/review-*/summary.json` + minimum schema), writes `.qfai/report/validate.json`,
39
+ and appends run logs to `.qfai/report/run-*/`; use `--fail-on error` (or `--fail-on warning`) to turn it into a CI gate,
40
+ and `--format github` to emit GitHub-friendly annotations.
41
+ Use `--phase refinement` only for local refinement checks; CI should use default/full validation.
37
42
  - `npx qfai report`
38
43
  - 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
44
  - `npx qfai doctor`
40
45
  - Diagnoses configuration discovery, path resolution, glob scanning, and `validate.json` inputs before running validate/report; use `--fail-on` to enforce failures in CI.
41
46
  - `npx qfai prototyping --autogen-ui-fidelity --base-url <url>`
42
- - Auto-generates `uiFidelity` evidence by crawling UI routes and collecting DOM labels; writes to `.qfai/evidence/prototyping.json` (or `--evidence-out <path>`). Requires `--base-url` or `QFAI_PROTOTYPE_BASE_URL` to specify the running application URL. Use `--autogen-only` to fail when generation fails (for CI gates). Enable with `QFAI_PROTOTYPE_FIDELITY_AUTOGEN=1` as an alternative to `--autogen-ui-fidelity`.
47
+ - Auto-generates `uiFidelity` evidence by crawling UI routes and collecting DOM labels;
48
+ writes to `.qfai/evidence/prototyping.json` (or `--evidence-out <path>`).
49
+ Requires `--base-url` or `QFAI_PROTOTYPE_BASE_URL` to specify the running application URL.
50
+ Use `--autogen-only` to fail when generation fails (for CI gates).
51
+ Enable with `QFAI_PROTOTYPE_FIDELITY_AUTOGEN=1` as an alternative to `--autogen-ui-fidelity`.
43
52
 
44
53
  ## ATDD annotation hard gate (v1.4.36)
45
54
 
@@ -103,10 +112,11 @@ The agent reads QFAI assets under `.qfai/assistant/` and produces or updates SDD
103
112
 
104
113
  QFAI includes a small set of custom skills (stored under `.qfai/assistant/skills/`) designed to keep the workflow opinionated and repeatable.
105
114
 
106
- - **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.
107
- - **qfai-discuss**: Turn an idea into clear requirements by discussing scope, constraints, risks, and open questions.
108
- - **qfai-require**: Produce a fixed 9-file require-pack (`01_Sources.md`..`09_delta.md`) under `.qfai/require/require-<ts>/`.
109
- - **qfai-sdd**: Unified SDD entrypoint with require-pack preflight guard (missing/incomplete/blocking OQ causes stop + next action guidance).
115
+ - **qfai-configure**: Analyze the repository (language, frameworks, test layout, directory structure)
116
+ and tailor `qfai.config.yaml` accordingly (especially `testFileGlobs`).
117
+ Run this once right after `npx qfai init`, and re-run it when the repository structure changes.
118
+ - **qfai-discussion**: Run a unified structured discussion that merges discuss and require into a single 15-file discussion pack under `.qfai/discussion/discussion-<ts>/`.
119
+ - **qfai-sdd**: Unified SDD entrypoint with discussion-pack preflight guard (missing/incomplete/blocking OQ causes stop + next action guidance).
110
120
  - **qfai-prototyping**: Build an all-spec contract-aligned skeleton and prove runtime coverage before deep coding.
111
121
  - **qfai-atdd**: Implement acceptance tests driven by specs/scenarios.
112
122
  - **qfai-tdd-red / qfai-tdd-green / qfai-tdd-refactor (deprecated wrappers)**: Legacy entrypoints kept for backward compatibility only. They return deprecation guidance and route to `/qfai-atdd` + `/qfai-verify`.
@@ -133,15 +143,10 @@ AG->>R: Update qfai.config.yaml (testFileGlobs, etc.)
133
143
  AG-->>U: Config tuned to this repo
134
144
 
135
145
  opt If you only have an idea
136
- U->>AG: Run /qfai-discuss
137
- AG-->>U: Structured discuss package (.qfai/discuss/discuss-<ts>/)
146
+ U->>AG: Run /qfai-discussion
147
+ AG-->>U: Structured discussion package (.qfai/discussion/discussion-<ts>/)
138
148
  end
139
149
 
140
- U->>AG: Run /qfai-require
141
- AG->>Q: Read .qfai/assistant/skills/qfai-require/SKILL.md
142
- AG->>R: Create/Update require-pack under require-<ts> (01_Sources..09_delta)
143
- AG-->>U: Require-pack ready
144
-
145
150
  U->>AG: Run /qfai-sdd
146
151
  AG->>Q: Read .qfai/assistant/skills/qfai-sdd/SKILL.md
147
152
  AG->>R: Preflight + create/refine layered specs + finalize 10_Plan + 09_delta
@@ -175,7 +180,7 @@ Operational notes.
175
180
 
176
181
  - Each custom skill must output in the user’s language (absolute requirement).
177
182
  - Each custom skill must end with a completion message that enumerates all available next actions and clearly states what to do for each option.
178
- - Except `qfai-discuss`, each skill must analyze the project context (architecture, tech stack, test framework, repo structure) before generating artifacts or code.
183
+ - Except `qfai-discussion`, each skill must analyze the project context (architecture, tech stack, test framework, repo structure) before generating artifacts or code.
179
184
  - Skills should delegate work to multiple role-based sub-agents (Planner, Architect, Contract Designer, QA, Code Reviewer, etc.) to emulate a real delivery flow.
180
185
  - Change classification (Primary/Tags) is required in `09_delta.md` and recommended in PRs. See `.qfai/assistant/instructions/change-classification.md`.
181
186
  - Verification planning is recorded in `09_delta.md` (`Verification -> Plan`) and validated in CI (`VFY-*` rules).
@@ -192,7 +197,7 @@ Example: override paths and traceability globs.
192
197
  paths:
193
198
  contractsDir: .qfai/contracts
194
199
  specsDir: .qfai/specs
195
- requireDir: .qfai/require
200
+ discussionDir: .qfai/discussion
196
201
  outDir: .qfai/report
197
202
  skillsDir: .qfai/assistant/skills
198
203
  srcDir: src
@@ -232,23 +237,22 @@ Traceability is validated across these artifacts, so code changes remain grounde
232
237
 
233
238
  ```mermaid
234
239
  flowchart LR
235
- S[.qfai/specs/** (layered 01..10)] --> V[qfai validate]
236
- C[.qfai/contracts/**] --> V
237
- V --> R[.qfai/report/**]
240
+ S[".qfai/specs/** (layered 01..10)"] --> V["qfai validate"]
241
+ C[".qfai/contracts/**"] --> V
242
+ V --> R[".qfai/report/**"]
238
243
  ```
239
244
 
240
245
  - Specs SSOT: `.qfai/specs/**` (layered files `01_Spec.md`..`09_delta.md` + shared delta layer)
241
246
  - Contracts SSOT: `.qfai/contracts/**`
242
247
  - Report outputs (`.qfai/report/**`) are derived artifacts and not SSOT.
243
248
 
244
- ## Minimal tutorial (v1.4.36)
249
+ ## Minimal tutorial (v1.5.0)
245
250
 
246
251
  1. `npx qfai init`
247
- 2. Run `/qfai-discuss` to structure scope and open questions.
248
- 3. Run `/qfai-require` to produce a require pack (`01_Sources`..`09_delta`) under `.qfai/require/require-<ts>/`.
249
- 4. Run `/qfai-sdd` to build layered specs and finalized plans.
250
- 5. For each completed review cycle, append artifacts under `.qfai/review/review-<timestamp>/`.
251
- 6. Run `npx qfai validate` then `npx qfai report`.
252
+ 2. Run `/qfai-discussion` to structure scope, open questions, and produce a discussion pack under `.qfai/discussion/discussion-<ts>/`.
253
+ 3. Run `/qfai-sdd` to build layered specs and finalized plans.
254
+ 4. For each completed review cycle, append artifacts under `.qfai/review/review-<timestamp>/`.
255
+ 5. Run `npx qfai validate` then `npx qfai report`.
252
256
 
253
257
  Release gate behavior:
254
258
 
@@ -335,12 +339,10 @@ Typical customizations.
335
339
  │ │ ├── skills
336
340
  │ │ │ ├── qfai-configure
337
341
  │ │ │ │ └── SKILL.md
338
- │ │ │ ├── qfai-discuss
342
+ │ │ │ ├── qfai-discussion
339
343
  │ │ │ │ └── SKILL.md
340
344
  │ │ │ ├── qfai-prototyping
341
345
  │ │ │ │ └── SKILL.md
342
- │ │ │ ├── qfai-require
343
- │ │ │ │ └── SKILL.md
344
346
  │ │ │ ├── qfai-sdd
345
347
  │ │ │ │ └── SKILL.md
346
348
  │ │ │ ├── qfai-atdd
@@ -14,8 +14,7 @@ This folder is generated by `qfai init` and designed to be:
14
14
 
15
15
  ```mermaid
16
16
  flowchart TD
17
- A[/qfai-discuss/] --> B[/qfai-require/]
18
- B --> C[/qfai-sdd/]
17
+ A[/qfai-discussion/] --> C[/qfai-sdd/]
19
18
  C --> D[/qfai-prototyping/]
20
19
  D --> E[/qfai-atdd/]
21
20
  E --> F[/qfai-tdd-red/]
@@ -72,7 +72,7 @@ Legacy note:
72
72
 
73
73
  ### Stage 0 — Steering refresh contract (mandatory)
74
74
 
75
- At the beginning of each stage (`qfai-discuss`, `qfai-require`, `qfai-sdd`, `qfai-prototyping`, `qfai-atdd`, `qfai-verify`):
75
+ At the beginning of each stage (`qfai-discussion`, `qfai-sdd`, `qfai-prototyping`, `qfai-atdd`, `qfai-verify`):
76
76
 
77
77
  1. Check these steering files:
78
78
  - `.qfai/assistant/steering/manifest.md`
@@ -437,7 +437,7 @@ Provide:
437
437
  5. If specSections updated, list the chosen headings and evidence source.
438
438
  6. Open questions (blocking vs non-blocking).
439
439
 
440
- Suggest next step: `/qfai-require` (or `/qfai-discuss` if requirements are not ready).
440
+ Suggest next step: `/qfai-discussion` (or rerun `/qfai-configure` if configuration is not ready).
441
441
 
442
442
  ## DONE Declaration (Mandatory Output)
443
443
 
@@ -467,9 +467,9 @@ When you declare DONE, include:
467
467
 
468
468
  When this skill is complete, provide a final user-facing completion message and enumerate all actionable next steps.
469
469
 
470
- - Proceed (recommended): `/qfai-require`.
470
+ - Proceed (recommended): `/qfai-discussion`.
471
471
  Action: run it to formalize requirements from the configured project context.
472
- - Requirements are still unclear: `/qfai-discuss`.
472
+ - Discussion needs more input: rerun `/qfai-discussion`.
473
473
  Action: collect missing scope, constraints, and assumptions first.
474
474
  - Configuration needs refinement: rerun `/qfai-configure`.
475
475
  Action: provide additional include/exclude evidence and update `qfai.config.yaml`.
@@ -0,0 +1,331 @@
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
+ ---
9
+
10
+ name: qfai-discussion
11
+ title: QFAI Discussion (Unified Discuss + Require)
12
+ description: "Run structured discussion that merges discuss and require into a single 15-file discussion pack with OQ-driven exit."
13
+ argument-hint: "<idea-or-problem> [--auto]"
14
+ allowed-tools: [Read, Glob, Write, TodoWrite, Task, Bash]
15
+ roles: [Researcher, Facilitator, Interviewer, RequirementsAnalyst, QAEngineer, Planner]
16
+ mode: interactive-by-default
17
+
18
+ ---
19
+
20
+ # /qfai-discussion - Unified Discuss + Require
21
+
22
+ [DRIFT-PROTOCOL:MANDATORY]
23
+
24
+ ## FORMAT SSOT (Mandatory)
25
+
26
+ - Before writing artifacts, read and follow:
27
+ - `.qfai/discussion/README.md`
28
+ - `.qfai/specs/README.md`
29
+ - `.qfai/evidence/README.md`
30
+ - `.qfai/assistant/steering/review-roster.yml`
31
+ - `.qfai/assistant/templates/rcp_footer.md`
32
+ - Keep templates as source of truth and preserve file naming/order.
33
+
34
+ ## Sub-agent Delegation (MANDATORY)
35
+
36
+ ### Orchestrator Protocol (MUST)
37
+
38
+ - Orchestrator may only create work orders, delegate tasks, integrate outputs, and present results.
39
+ - Orchestrator MUST NOT generate the primary artifact first draft.
40
+ - Orchestrator MUST NOT self-approve.
41
+
42
+ ### Capability Probe (MUST)
43
+
44
+ 1. Run one harmless Probe Task once at stage start.
45
+ 2. If subagents are unavailable, explicitly ask for Simulation mode approval.
46
+ 3. Without explicit approval, stop the stage.
47
+
48
+ ### Simulation mode (Opt-in only)
49
+
50
+ - Allowed only when user explicitly states `Simulation mode allowed`.
51
+ - Record both:
52
+ - `Subagents: simulated (reason: <why unavailable>)`
53
+ - `User approval: <quote or reference>`
54
+
55
+ ## Work Orders Summary
56
+
57
+ Every major artifact in this stage MUST include this table schema:
58
+
59
+ | Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
60
+ | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
61
+ | 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
62
+
63
+ ### Reviewer Gate (MUST)
64
+
65
+ - Delegate final completion gate to an independent Reviewer.
66
+ - Reviewer must check Drift Protocol compliance and alignment with `.qfai/assistant/steering/test-layers.md`.
67
+ - Test volume floors/ratios are not gates; they are risk signals.
68
+ - Do not declare DONE until Reviewer returns `PASS`; otherwise apply `REVISE`.
69
+
70
+ ## CRITICAL CONSTRAINTS (Read First)
71
+
72
+ - Output path is fixed: `.qfai/discussion/discussion-YYYYMMDDhhmmssSSS/`.
73
+ - Timestamp format is fixed to `YYYYMMDDhhmmssSSS` (3-digit milliseconds).
74
+ - Required fixed files (all 15 are mandatory):
75
+ - `01_Context.md`
76
+ - `02_Inception-Deck.md`
77
+ - `03_Story-Workshop.md`
78
+ - `04_Sources.md`
79
+ - `05_Scope.md`
80
+ - `06_REQ.md`
81
+ - `07_NFR.md`
82
+ - `08_Glossary.md`
83
+ - `09_Constraints.md`
84
+ - `10_Policy.md`
85
+ - `11_OQ-Register.md`
86
+ - `12_OQ-Resolution-Log.md`
87
+ - `13_Deferred.md`
88
+ - `14_Review-Request.md`
89
+ - `99_delta.md`
90
+ - Discussion completion requires `Disposition: open` count to be zero in `11_OQ-Register.md`.
91
+ - `deferred` is allowed only when required metadata is complete in `13_Deferred.md`.
92
+ - `03_Story-Workshop.md` MUST contain at least one Mermaid diagram in ` ```mermaid ` fences.
93
+ - Review roster is fixed by `.qfai/assistant/steering/review-roster.yml` and must be executed in full.
94
+ - RCP wording must be sourced from `.qfai/assistant/templates/rcp_footer.md`.
95
+ - Discussion artifacts are logs/rationale and must not duplicate spec SSOT.
96
+ - If diagrams are written, Mermaid syntax must be in ` ```mermaid ` fences only.
97
+ - Do not enforce fixed EX/BR or TC/EX ratios in this phase.
98
+ - Example Mapping is mandatory and must be captured as `Example Seeds` sections in `03_Story-Workshop.md`.
99
+ - OQ Register must include all mandatory columns: OQ-ID, Title, Gate, Disposition, Owner, Rationale, Options, Recommendation, Next-Decision-Point, Due, Evidence.
100
+ - Deferred table must include all mandatory columns: OQ-ID, Title, Gate, Deferred-Reason, Deferred-Until, Owner, Due, Severity, Impact, Mitigation, Evidence.
101
+
102
+ ## Goal
103
+
104
+ Produce a unified 15-file discussion pack with explicit decisions, requirements, OQ states, and rationale so `/qfai-sdd` starts without unresolved blockers.
105
+
106
+ ## Non-goals
107
+
108
+ - Editing `.qfai/specs/**` directly.
109
+ - Writing implementation-level details.
110
+ - Leaving open blockers hidden in free text.
111
+
112
+ ## Mandatory Outputs
113
+
114
+ - `.qfai/discussion/discussion-*/01_Context.md`
115
+ - `.qfai/discussion/discussion-*/02_Inception-Deck.md`
116
+ - `.qfai/discussion/discussion-*/03_Story-Workshop.md`
117
+ - `.qfai/discussion/discussion-*/04_Sources.md`
118
+ - `.qfai/discussion/discussion-*/05_Scope.md`
119
+ - `.qfai/discussion/discussion-*/06_REQ.md`
120
+ - `.qfai/discussion/discussion-*/07_NFR.md`
121
+ - `.qfai/discussion/discussion-*/08_Glossary.md`
122
+ - `.qfai/discussion/discussion-*/09_Constraints.md`
123
+ - `.qfai/discussion/discussion-*/10_Policy.md`
124
+ - `.qfai/discussion/discussion-*/11_OQ-Register.md`
125
+ - `.qfai/discussion/discussion-*/12_OQ-Resolution-Log.md`
126
+ - `.qfai/discussion/discussion-*/13_Deferred.md`
127
+ - `.qfai/discussion/discussion-*/14_Review-Request.md`
128
+ - `.qfai/discussion/discussion-*/99_delta.md`
129
+ - review artifacts under `.qfai/review/review-YYYYMMDDhhmmssSSS/`
130
+ - Evidence file: `.qfai/evidence/discussion-YYYYMMDDhhmmssSSS.md`
131
+ - Reviewer notes (`PASS` or `REVISE`)
132
+
133
+ ## Required Process
134
+
135
+ 1. Run the core interview for product concept, scope, stakeholders, and constraints (`01_Context.md`).
136
+ 2. Run Inception Deck (10 questions) for ambiguity removal and project alignment (`02_Inception-Deck.md`).
137
+ 3. Run Story Workshop to capture user stories, user flows, and at least one Mermaid diagram (`03_Story-Workshop.md`).
138
+ 4. Register source traceability in `04_Sources.md` with stable `SRC-XXXX` identifiers.
139
+ 5. Define scope boundaries and success criteria in `05_Scope.md`.
140
+ 6. Capture functional requirements in `06_REQ.md` with `REQ-0001` format.
141
+ 7. Capture non-functional requirements in `07_NFR.md` with `NFR-0001` format.
142
+ 8. Capture domain terms and definitions in `08_Glossary.md`.
143
+ 9. Capture constraints (technical, operational, legal, budget, deadline) in `09_Constraints.md`.
144
+ 10. Capture policies (security, compliance, etc.) in `10_Policy.md`.
145
+ 11. Run Example Mapping pass for each BR/AC candidate and capture `Example Seeds` in `03_Story-Workshop.md`.
146
+ 12. Update `11_OQ-Register.md` with all identified OQs using all mandatory columns.
147
+ 13. Run OQ resolution hearing repeatedly until open count is zero.
148
+ 14. Move deferred items to `13_Deferred.md` with all mandatory metadata columns.
149
+ 15. Update `12_OQ-Resolution-Log.md`, `14_Review-Request.md`, and `99_delta.md`.
150
+ 16. Request review and record Reviewer result.
151
+
152
+ ## Example Mapping Perspectives (Mandatory)
153
+
154
+ For each BR/AC candidate, enumerate concrete example seeds with these perspectives:
155
+
156
+ 1. Happy path
157
+ 2. Negative path
158
+ 3. Edge / boundary
159
+ 4. Permission / role
160
+ 5. State transition (if stateful)
161
+ 6. Idempotency / retry (if external I/O exists)
162
+
163
+ Rules:
164
+
165
+ - Use perspective coverage as the gate, not raw case counts.
166
+ - Mark intentionally skipped perspectives with reason and follow-up.
167
+ - Feed unresolved seeds into OQ items with owner and decision point.
168
+
169
+ ## OQ Data Model (Mandatory)
170
+
171
+ `11_OQ-Register.md` must include these fields for each OQ:
172
+
173
+ - `OQ-ID` (`OQ-0001` format)
174
+ - `Title`
175
+ - `Gate` (`discuss|require|sdd`)
176
+ - `Disposition` (`open|resolved|deferred|rejected`)
177
+ - `Owner` (`user|agent|team`)
178
+ - `Rationale` (required for deferred/rejected)
179
+ - `Options` (at least two alternatives and one recommended option)
180
+ - `Recommendation` (explicitly stated recommended option)
181
+ - `Next-Decision-Point` (required for deferred)
182
+ - `Due` (target date or milestone)
183
+ - `Evidence`
184
+
185
+ ## Deferred Metadata Rules (Mandatory)
186
+
187
+ `13_Deferred.md` must include:
188
+
189
+ - `OQ-ID`
190
+ - `Title`
191
+ - `Gate`
192
+ - `Deferred-Reason`
193
+ - `Deferred-Until`
194
+ - `Owner`
195
+ - `Due`
196
+ - `Severity` (`high|medium|low`)
197
+ - `Impact` (spec/tests/implementation/operations)
198
+ - `Mitigation`
199
+ - `Evidence`
200
+
201
+ ## Drift Protocol (Mandatory)
202
+
203
+ At any point during discussion, if the user changes direction or scope:
204
+
205
+ 1. Record the drift event in `99_delta.md` with Change Type = `Drift`.
206
+ 2. Assess impact on all 15 files.
207
+ 3. Update affected files and re-validate OQ register exit condition.
208
+ 4. If drift contradicts a previously rejected option, record in `99_delta.md` Rejected section with `Recurrence Prevention`.
209
+
210
+ ## Review Gate Artifacts (RCP)
211
+
212
+ For each review cycle, create:
213
+
214
+ - `.qfai/review/review-<timestamp>/review_request.md`
215
+ - `.qfai/review/review-<timestamp>/R01_<reviewer>.md`, `R02_<reviewer>.md`, ...
216
+ - `.qfai/review/review-<timestamp>/summary.json`
217
+
218
+ RCP rules:
219
+
220
+ - Append-only: create a new review pack for each cycle.
221
+ - Apply `.qfai/assistant/templates/rcp_footer.md` as the common footer rule set.
222
+ - Any `FAIL` requires return/fix/full rerun from the first reviewer.
223
+ - Mark fixed only when all reviewers are `PASS` or valid `N/A`.
224
+ - `summary.json` `target.kind` must be `"discussion"`.
225
+
226
+ ## RCP Footer Include (MUST)
227
+
228
+ - Include and follow `.qfai/assistant/templates/rcp_footer.md` without rewriting it per skill.
229
+ - Roster and loop rules must stay synchronized with the footer SSOT.
230
+
231
+ ## Required Coverage Topics
232
+
233
+ Before completion, confirm all are covered:
234
+
235
+ 1. product concept and target users
236
+ 2. scope boundary and anti-goals
237
+ 3. user stories and user flows (with Mermaid diagrams)
238
+ 4. functional requirements (REQ) with source traceability
239
+ 5. non-functional requirements (NFR) with measurable targets
240
+ 6. performance constraints and SLO assumptions
241
+ 7. security constraints and risk controls
242
+ 8. domain glossary consistency
243
+ 9. technical and operational constraints
244
+ 10. project policies
245
+
246
+ ## Completion Contract (Shared)
247
+
248
+ Before declaring completion, you MUST:
249
+
250
+ - verify all 15 mandatory output files exist and are populated;
251
+ - ensure `Disposition: open` count is zero in `11_OQ-Register.md`;
252
+ - ensure every deferred item has full metadata in `13_Deferred.md`;
253
+ - ensure `Example Seeds` sections are present and perspective coverage is explicit in `03_Story-Workshop.md`;
254
+ - ensure `03_Story-Workshop.md` includes at least one Mermaid diagram;
255
+ - avoid duplicating finalized spec content in discussion outputs.
256
+
257
+ ## Evidence (MANDATORY)
258
+
259
+ Create/update: `.qfai/evidence/discussion-YYYYMMDDhhmmssSSS.md`
260
+
261
+ Required sections:
262
+
263
+ - Objective
264
+ - Inputs reviewed (files/paths)
265
+ - Interview summary
266
+ - Inception Deck summary
267
+ - Story Workshop summary
268
+ - Requirements summary (REQ count, NFR count)
269
+ - OQ register summary
270
+ - Deferred summary
271
+ - Work Orders Summary
272
+ - Reviewer result (`PASS`/`REVISE`)
273
+
274
+ ## DONE Declaration (Mandatory Output)
275
+
276
+ When done, report:
277
+
278
+ - generated discussion path (`.qfai/discussion/discussion-*/`)
279
+ - open OQ count
280
+ - deferred OQ count
281
+ - REQ count
282
+ - NFR count
283
+ - reviewer result
284
+ - ready-for-next command (`/qfai-sdd`)
285
+
286
+ ## FINAL CHECKLIST (Check Last)
287
+
288
+ - [ ] CRITICAL CONSTRAINTS were followed.
289
+ - [ ] All 15 required discussion files `01..14, 99` were produced.
290
+ - [ ] OQ register fields follow the mandatory data model (all 11 columns present).
291
+ - [ ] Deferred table fields follow the mandatory data model (all 11 columns present).
292
+ - [ ] `Disposition: open` count is zero at completion.
293
+ - [ ] Deferred items include required metadata.
294
+ - [ ] `03_Story-Workshop.md` includes at least one Mermaid diagram.
295
+ - [ ] Mermaid fence rules were satisfied when diagrams were used.
296
+ - [ ] Evidence file exists and includes Work Orders Summary + Reviewer result.
297
+ - [ ] Reviewer returned `PASS`.
298
+
299
+ ## Completion Checklist (MUST)
300
+
301
+ - [ ] This skill's Definition of Done is satisfied.
302
+ - [ ] Required artifacts were produced or updated (if applicable).
303
+ - [ ] Diagram artifacts follow Mermaid fence rules (if diagrams were used).
304
+ - [ ] Open questions were logged to the proper OQ file (if applicable).
305
+ - [ ] The completion message was presented to the user.
306
+ - [ ] Next actions were enumerated for all available options.
307
+
308
+ ## Review Cycle Checklist (MUST)
309
+
310
+ - [ ] Review artifacts were generated for each required discussion review cycle.
311
+ - [ ] All required reviewers completed their reviews for each review pack.
312
+ - [ ] Any feedback triggered return/fix and a new review pack was appended.
313
+ - [ ] `summary.json` satisfies the required schema with `target.kind: "discussion"`.
314
+
315
+ ## Completion Message & Next Actions (MUST)
316
+
317
+ You MUST end the user-facing output with a handoff sentence to `/qfai-sdd` in the active user language.
318
+
319
+ - Japanese output (use this exact sentence):
320
+ ディスカッションが完了しました。他に要望などがあればご提示ください。問題なければ『/qfai-sdd』と入力してください。
321
+ - Non-Japanese output:
322
+ Use the same meaning in the user's language, and keep `/qfai-sdd` as a literal command token.
323
+
324
+ - Proceed (recommended): `/qfai-sdd`.
325
+ Action: run preflight on the latest discussion pack and generate shared/spec artifacts.
326
+ - Upstream idea is still unclear: rerun `/qfai-discussion`.
327
+ Action: continue discussion loops until OQ states are explicit and complete.
328
+ - Need additional risk analysis before SDD:
329
+ Action: update `03_Story-Workshop.md` and `11_OQ-Register.md` with additional findings.
330
+
331
+ ````
@@ -0,0 +1,37 @@
1
+ # 01 Context
2
+
3
+ ## Metadata
4
+
5
+ | Key | Value |
6
+ | ------------- | ---------------------------- |
7
+ | Discussion ID | discussion-YYYYMMDDhhmmssSSS |
8
+ | Date | YYYY-MM-DD |
9
+ | Owner | <role/person> |
10
+ | Source | <request/context> |
11
+
12
+ ## Goal and Completion Criteria
13
+
14
+ - Goal:
15
+ - Measurable completion criteria:
16
+
17
+ ## Stakeholders
18
+
19
+ - Primary stakeholders:
20
+ - Secondary stakeholders:
21
+
22
+ ## Background
23
+
24
+ - Business context:
25
+ - Technical context:
26
+ - Historical context:
27
+
28
+ ## Inputs
29
+
30
+ - Existing repository facts:
31
+ - External references:
32
+ - Assumptions:
33
+
34
+ ## Key Issues
35
+
36
+ - Issue 1:
37
+ - Issue 2:
@@ -0,0 +1,64 @@
1
+ # 02 Inception Deck
2
+
3
+ ## 1. Why Are We Here?
4
+
5
+ - Purpose:
6
+
7
+ ## 2. Elevator Pitch
8
+
9
+ - For: <target users>
10
+ - Who: <need/problem>
11
+ - The: <product name>
12
+ - Is a: <category>
13
+ - That: <key benefit>
14
+ - Unlike: <alternatives>
15
+ - Our product: <differentiator>
16
+
17
+ ## 3. Product Box (Feature highlights)
18
+
19
+ - Headline feature 1:
20
+ - Headline feature 2:
21
+ - Headline feature 3:
22
+
23
+ ## 4. NOT List (Out of Scope)
24
+
25
+ | In Scope | Out of Scope |
26
+ | -------- | ------------ |
27
+ | Item 1 | Item A |
28
+
29
+ ## 5. Meet Your Neighbors (Stakeholders & Dependencies)
30
+
31
+ - Upstream dependencies:
32
+ - Downstream dependencies:
33
+ - External integrations:
34
+
35
+ ## 6. Show the Solution (Architecture Overview)
36
+
37
+ - High-level architecture:
38
+ - Key components:
39
+
40
+ ## 7. What Keeps Us Up at Night (Risks)
41
+
42
+ | Risk | Probability | Impact | Mitigation |
43
+ | ---- | ----------- | ------ | ---------- |
44
+ | R1 | medium | high | TBD |
45
+
46
+ ## 8. Size It Up (Effort & Timeline)
47
+
48
+ - Estimated effort:
49
+ - Target timeline:
50
+
51
+ ## 9. What's Going to Give (Trade-offs)
52
+
53
+ | Dimension | Priority | Notes |
54
+ | --------- | -------- | ----- |
55
+ | Scope | 1 | |
56
+ | Quality | 2 | |
57
+ | Time | 3 | |
58
+ | Budget | 4 | |
59
+
60
+ ## 10. What's It Going to Take (Team & Resources)
61
+
62
+ - Required skills:
63
+ - Team composition:
64
+ - Infrastructure:
@@ -0,0 +1,44 @@
1
+ # 03 Story Workshop
2
+
3
+ ## User Stories
4
+
5
+ ### US-001: <Story Title>
6
+
7
+ - As a: <role>
8
+ - I want: <action>
9
+ - So that: <benefit>
10
+
11
+ #### Acceptance Criteria
12
+
13
+ - AC-001-01:
14
+ - AC-001-02:
15
+
16
+ #### Example Seeds
17
+
18
+ | Perspective | Example | Status |
19
+ | ------------------- | ---------------- | ------ |
20
+ | Happy path | <example> | seed |
21
+ | Negative path | <example> | seed |
22
+ | Edge / boundary | <example> | seed |
23
+ | Permission / role | <example> | seed |
24
+ | State transition | <example or N/A> | seed |
25
+ | Idempotency / retry | <example or N/A> | seed |
26
+
27
+ ## User Flows
28
+
29
+ ```mermaid
30
+ flowchart TD
31
+ A["Start"] --> B["Action 1"]
32
+ B --> C{"Decision"}
33
+ C -->|Yes| D["Action 2"]
34
+ C -->|No| E["Action 3"]
35
+ D --> F["End"]
36
+ E --> F
37
+ ```
38
+
39
+ ## Flow Descriptions
40
+
41
+ - Flow 1:
42
+ - Entry point:
43
+ - Steps:
44
+ - Exit point:
@@ -0,0 +1,18 @@
1
+ # 04 Sources
2
+
3
+ ## Source Registry
4
+
5
+ | SRC-ID | Title | Type | URL / Path | Retrieved | Notes |
6
+ | -------- | ----- | ------- | ---------- | ---------- | ----- |
7
+ | SRC-0001 | TBD | primary | <link> | YYYY-MM-DD | - |
8
+
9
+ ## Source Types
10
+
11
+ - `primary`: First-hand evidence (interviews, documents, code).
12
+ - `secondary`: Derived information (summaries, analyses).
13
+ - `external`: Third-party references (specs, RFCs, vendor docs).
14
+
15
+ ## Traceability
16
+
17
+ - Each REQ/NFR should reference at least one SRC-ID.
18
+ - Sources without REQ/NFR links should be reviewed for relevance.