qfai 1.4.23 → 1.4.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -210,7 +210,7 @@ flowchart LR
210
210
  - Contracts SSOT: `.qfai/contracts/**`
211
211
  - Report outputs (`.qfai/report/**`) are derived artifacts and not SSOT.
212
212
 
213
- ## Minimal tutorial (v1.4.23)
213
+ ## Minimal tutorial (v1.4.24)
214
214
 
215
215
  1. `npx qfai init`
216
216
  2. Run `/qfai-discuss` to structure scope and open questions.
@@ -237,8 +237,8 @@ Release gate behavior:
237
237
 
238
238
  ## Continuous integration
239
239
 
240
- QFAI v1.4.23 generates `.github/**` only for Copilot integration wrappers
241
- (`.github/prompts`, `.github/agents`).
240
+ QFAI v1.4.24 generates integration wrappers under `.agents/**`, `.claude/**`,
241
+ `.github/**`, and `.codex/**`.
242
242
  It does not generate GitHub Actions workflows.
243
243
  Configure CI in your own platform and run:
244
244
 
@@ -272,6 +272,11 @@ Typical customizations.
272
272
 
273
273
  ```text
274
274
  .
275
+ ├── .agents
276
+ │ ├── README.md
277
+ │ └── skills
278
+ │ └── qfai-configure
279
+ │ └── SKILL.md
275
280
  ├── .qfai
276
281
  │ ├── assistant
277
282
  │ │ ├── agents
@@ -374,6 +379,7 @@ Typical customizations.
374
379
 
375
380
  Integration wrappers are also generated for immediate use:
376
381
 
382
+ - Agents/Codex VS Code: `.agents/skills/**`
377
383
  - Claude Code: `.claude/commands/**`, `.claude/agents/**`
378
384
  - GitHub Copilot: `.github/prompts/**`, `.github/agents/**`
379
385
  - Codex: `.codex/skills/**`
@@ -381,7 +387,7 @@ Integration wrappers are also generated for immediate use:
381
387
  ## Agent integrations
382
388
 
383
389
  `npx qfai init` installs canonical skills under `.qfai/assistant/skills/**` (SSOT)
384
- and generates thin wrapper assets for Copilot / Claude Code / Codex.
390
+ and generates thin wrapper assets for Agents/Codex VS Code / Copilot / Claude Code / Codex.
385
391
  If wrapper assets drift from canonical skills, rerun `npx qfai init --force` to resync.
386
392
 
387
393
  ## Contributing (for QFAI maintainers)
@@ -161,6 +161,8 @@ Rules:
161
161
  - If `plan.md` exists, you MUST follow it as implementation constraints.
162
162
  - `implementation-brief.md` is deprecated and must not be used as How SSOT.
163
163
  - If `plan.md` is missing, STOP and run `/qfai-sdd` before proceeding.
164
+ - If `_shared/05_Contracts.md` (or equivalent contracts index) references any contract ID whose declared file does not exist under `.qfai/contracts/**`, STOP and rerun `/qfai-sdd`.
165
+ - `/qfai-prototyping` MUST NOT create new contract files; contracts are strict inputs in this stage.
164
166
  - You MUST produce the required evidence file: `.qfai/evidence/prototyping-<spec-id>.md`.
165
167
  - `.qfai/evidence/` is intentionally NOT tracked by Git (it ships with a local `.gitignore`).
166
168
  - Do NOT commit evidence files; summarize key outcomes in the PR description instead.
@@ -225,6 +227,7 @@ Build a minimal runnable vertical slice from contracts so the app boots and user
225
227
  - ✅ You MAY add minimal “smoke scripts” (e.g., `scripts/smoke.ts`) if they help manual verification.
226
228
  - ❌ Do NOT implement acceptance tests here (that is `/qfai-atdd`).
227
229
  - ❌ Do NOT implement unit/component tests here (that is TDD phases).
230
+ - ❌ Do NOT create new files under `.qfai/contracts/**` in this stage.
228
231
  - ❌ Do NOT change `.qfai/**/README.md` content. They are templates and remain SSOT.
229
232
 
230
233
  ## Mission (what “prototype” means)
@@ -171,7 +171,7 @@ Rules:
171
171
 
172
172
  ## Workflow Convention (Mandatory)
173
173
 
174
- - **This skill proceeds in this exact order: Outline -> Slice -> Plan finalize -> Delta update.**
174
+ - **This skill proceeds in this exact order: Contracts-first -> Outline -> Slice -> Plan finalize -> Delta update.**
175
175
  - **Upper-to-lower references are forbidden. Lower-to-upper references are allowed.**
176
176
  - **Connections between layers MUST be represented by IDs and required edges (`US->AC->BR->EX->TC`).**
177
177
  - **Plan finalize MUST happen after at least one user-story slice is grounded.**
@@ -184,6 +184,17 @@ Rules:
184
184
  - `.qfai/assistant/skills/qfai-sdd/templates/specs/`
185
185
  - `.qfai/assistant/skills/qfai-sdd/templates/contracts/`
186
186
  - Always write `.qfai/report/preflight_summary.md` before generating shared/spec artifacts.
187
+ - Contracts are contract-first mandatory outputs in this skill:
188
+ - create/update `.qfai/contracts/(api|db|ui)/**` before shared/spec slices
189
+ - `_shared/05_Contracts.md` must include a Contract Index with short IDs (`DB-001`, `API-001`, `UI-001`)
190
+ - every indexed short ID must map to a declared file with `QFAI-CONTRACT-ID`:
191
+ - `DB-001 -> CON-DB-0001 -> db-0001-<slug>.sql`
192
+ - `API-001 -> CON-API-0001 -> api-0001-<slug>.yaml`
193
+ - `UI-001 -> CON-UI-0001 -> ui-0001-<slug>.yaml`
194
+ - `<slug>` comes from entity/router/screen and must be sanitized to kebab-case
195
+ - allocate new contract IDs by scanning existing declarations and using next sequential NNNN per kind
196
+ - never duplicate existing declared IDs; update in-place when the contract already exists
197
+ - contract stubs must be syntactically valid (OpenAPI YAML / UI YAML / executable SQL skeleton)
187
198
  - `/qfai-sdd` must stop when require-pack is missing/incomplete or has blocking OQ (guide to `/qfai-require` or `/qfai-discuss` first).
188
199
  - Review roster is fixed by `.qfai/assistant/steering/review-roster.yml` and must be executed in full.
189
200
  - RCP wording must be sourced from `.qfai/assistant/templates/rcp_footer.md`.
@@ -205,6 +216,22 @@ Rules:
205
216
  - ask the user when certainty is below threshold
206
217
  - unresolved decisions become explicit Open Questions
207
218
 
219
+ ### Phase 0 - Contracts-first (mandatory)
220
+
221
+ Create/update:
222
+
223
+ - `.qfai/contracts/api/**`
224
+ - `.qfai/contracts/db/**`
225
+ - `.qfai/contracts/ui/**`
226
+ - `_shared/05_Contracts.md` Contract Index table (DB/API/UI short IDs)
227
+
228
+ Rules:
229
+
230
+ - This phase MUST complete before Outline/Slice.
231
+ - If `_shared/05_Contracts.md` lists an ID, the corresponding declared contract file MUST exist.
232
+ - If a contract is empty, create a valid minimal stub and include `QFAI-CONTRACT-ID`.
233
+ - `none` is allowed only when there is no contract impact and rationale is written.
234
+
208
235
  ### Phase 1 - Outline (layer-first)
209
236
 
210
237
  Create/update:
@@ -216,11 +243,15 @@ Create/update:
216
243
  - `_shared/05_Contracts.md`
217
244
  - `_shared/06_Glossary.md`
218
245
  - `_shared/07_Constraints.md`
246
+ - `_shared/08_Decisions.md`
247
+ - `_shared/09_Open-questions.md`
248
+ - `_shared/10_delta.md`
219
249
 
220
250
  Rules:
221
251
 
222
252
  - Temporary `TBD` is allowed, but each `TBD` must be mirrored into `_shared/09_Open-questions.md`.
223
253
  - `_shared/04_Business-Flow.md` must include Mermaid and keep diagram syntax inside ` ```mermaid ` fences.
254
+ - `_shared/08_Decisions.md` and `_shared/10_delta.md` must exist even when empty, and must explicitly state `0 items`.
224
255
 
225
256
  ### Phase 2 - Slice (slice-first)
226
257
 
@@ -232,6 +263,8 @@ Create/update:
232
263
  - `spec-XXXX/04_Business-Rules.md`
233
264
  - `spec-XXXX/05_Examples.md`
234
265
  - `spec-XXXX/06_Test-Cases.md`
266
+ - `spec-XXXX/07_Decisions.md`
267
+ - `spec-XXXX/08_Open-questions.md`
235
268
 
236
269
  Slice gate (must pass before Phase 3):
237
270
 
@@ -239,6 +272,7 @@ Slice gate (must pass before Phase 3):
239
272
  - For each AC, BR and SC must exist.
240
273
  - For each TC, EX reference must exist.
241
274
  - `SC` tags must align with the target `spec-XXXX` namespace.
275
+ - `07_Decisions.md` and `08_Open-questions.md` must exist even when empty and include explicit `0 items` statements.
242
276
 
243
277
  ### Phase 3 - Plan finalize
244
278
 
@@ -291,15 +325,20 @@ Create or update layered SDD artifacts in one run so downstream execution phases
291
325
  - `.qfai/specs/_shared/05_Contracts.md`
292
326
  - `.qfai/specs/_shared/06_Glossary.md`
293
327
  - `.qfai/specs/_shared/07_Constraints.md`
328
+ - `.qfai/specs/_shared/08_Decisions.md`
329
+ - `.qfai/specs/_shared/09_Open-questions.md`
330
+ - `.qfai/specs/_shared/10_delta.md`
294
331
  - `.qfai/specs/spec-XXXX/01_Spec.md`
295
332
  - `.qfai/specs/spec-XXXX/02_User-stories.md`
296
333
  - `.qfai/specs/spec-XXXX/03_Acceptance-Criteria.md`
297
334
  - `.qfai/specs/spec-XXXX/04_Business-Rules.md`
298
335
  - `.qfai/specs/spec-XXXX/05_Examples.md`
299
336
  - `.qfai/specs/spec-XXXX/06_Test-Cases.md`
337
+ - `.qfai/specs/spec-XXXX/07_Decisions.md`
338
+ - `.qfai/specs/spec-XXXX/08_Open-questions.md`
300
339
  - `.qfai/specs/spec-XXXX/10_Plan.md`
301
340
  - `.qfai/specs/spec-XXXX/09_delta.md` (or `*_delta.md`)
302
- - Updated contracts under `.qfai/contracts/**` when required
341
+ - Updated contracts under `.qfai/contracts/**` (mandatory in this workflow)
303
342
  - `.qfai/report/preflight_summary.md`
304
343
  - Evidence file: `.qfai/evidence/sdd-<spec-id>.md`
305
344
 
@@ -309,11 +348,12 @@ Create or update layered SDD artifacts in one run so downstream execution phases
309
348
  2. If readiness checks fail, stop and show blockers with `/qfai-require` and `/qfai-discuss`.
310
349
  3. Analyze repository context, existing artifacts, constraints, and open decisions.
311
350
  4. Write `.qfai/report/preflight_summary.md` from `templates/report/preflight_summary.md`.
312
- 5. Execute Phase 1 (Outline) in layer-first order.
313
- 6. Execute Phase 2 (Slice) for at least one user-story slice and pass slice gate.
314
- 7. Execute Phase 3 (Plan finalize) and make `10_Plan.md` actionable as How-only.
315
- 8. Execute Phase 4 (Delta update) and record adoption/rejection rationale.
316
- 9. Run static checks and record outcomes in evidence.
351
+ 5. Execute Phase 0 (Contracts-first) and ensure `_shared/05_Contracts.md` index and `.qfai/contracts/**` are aligned.
352
+ 6. Execute Phase 1 (Outline) in layer-first order.
353
+ 7. Execute Phase 2 (Slice) for at least one user-story slice and pass slice gate.
354
+ 8. Execute Phase 3 (Plan finalize) and make `10_Plan.md` actionable as How-only.
355
+ 9. Execute Phase 4 (Delta update) and record adoption/rejection rationale.
356
+ 10. Run static checks and record outcomes in evidence.
317
357
 
318
358
  ## Unified SDD Quality Gate
319
359
 
@@ -352,7 +392,7 @@ Required sections:
352
392
  When declaring DONE, include:
353
393
 
354
394
  - Referenced inputs and spec-id
355
- - Confirmation of phase order: Outline -> Slice -> Plan finalize -> Delta update
395
+ - Confirmation of phase order: Contracts-first -> Outline -> Slice -> Plan finalize -> Delta update
356
396
  - Decision record IDs touched in `09_delta.md` (or `*_delta.md`)
357
397
  - Confirmation that no rejected option was reintroduced (or list RE-OPEN IDs)
358
398
  - Unified SDD quality gate result
@@ -361,7 +401,8 @@ When declaring DONE, include:
361
401
 
362
402
  - [ ] CRITICAL CONSTRAINTS were followed.
363
403
  - [ ] `.qfai/report/preflight_summary.md` was generated before spec authoring.
364
- - [ ] Outline -> Slice -> Plan finalize -> Delta update order was preserved.
404
+ - [ ] Contracts-first -> Outline -> Slice -> Plan finalize -> Delta update order was preserved.
405
+ - [ ] `_shared/05_Contracts.md` index and `.qfai/contracts/**` declared files are aligned.
365
406
  - [ ] Upper-to-lower references were not introduced.
366
407
  - [ ] At least one user-story slice passed gate before plan finalization.
367
408
  - [ ] Required `_shared` + `spec-XXXX` outputs exist and are internally consistent.
@@ -392,7 +433,7 @@ When this skill is complete, provide a final user-facing completion message and
392
433
  Action: build contract-aligned skeleton implementation before deeper coding.
393
434
  - Test-first path: `/qfai-atdd`.
394
435
  Action: implement acceptance tests from the finalized spec pack.
395
- - Want to add contracts:
396
- Action: create files under `.qfai/contracts/(api|db|ui)/` from `templates/contracts/*` and declare `QFAI-CONTRACT-ID`.
436
+ - Contracts status:
437
+ Action: confirm contracts were created/updated under `.qfai/contracts/**` and referenced by `_shared/05_Contracts.md`.
397
438
  - Spec pack needs correction: rerun `/qfai-sdd`.
398
439
  Action: fix layered `_shared + spec-XXXX` consistency and decision records, then regenerate evidence.
@@ -2,25 +2,49 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- - Describe API/UI/DB contract boundaries in shared language.
6
- - Model relationships with Mermaid when expressing entities or ownership.
5
+ - Keep contracts as SSOT under `.qfai/contracts/**` with deterministic IDs.
6
+ - Use this file as a readable index with short IDs for planning and review.
7
+
8
+ ## Contract Index
9
+
10
+ ### DB Contracts
11
+
12
+ | Short ID | Entity | Declared ID | File | Purpose |
13
+ | -------- | ------------ | ----------- | --------------------------------------- | ----------------- |
14
+ | DB-001 | order_drafts | CON-DB-0001 | `.qfai/contracts/db/db-0001-<slug>.sql` | draft persistence |
15
+
16
+ ### API Contracts
17
+
18
+ | Short ID | Router | Declared ID | File | Purpose |
19
+ | -------- | ----------- | ------------ | ------------------------------------------ | ------------ |
20
+ | API-001 | /api/orders | CON-API-0001 | `.qfai/contracts/api/api-0001-<slug>.yaml` | create draft |
21
+
22
+ ### UI Contracts
23
+
24
+ | Short ID | Screen | Declared ID | File | Purpose |
25
+ | -------- | ------------ | ----------- | ---------------------------------------- | ---------------- |
26
+ | UI-001 | order-create | CON-UI-0001 | `.qfai/contracts/ui/ui-0001-<slug>.yaml` | draft input form |
27
+
28
+ ## Mapping Rules
29
+
30
+ - `DB-001` maps to `CON-DB-0001`, file `db-0001-<slug>.sql`.
31
+ - `API-001` maps to `CON-API-0001`, file `api-0001-<slug>.yaml`.
32
+ - `UI-001` maps to `CON-UI-0001`, file `ui-0001-<slug>.yaml`.
33
+ - `<slug>` must be kebab-case from entity/router/screen.
34
+ - If no contracts are needed, keep each table and state `0 items` explicitly.
7
35
 
8
36
  ## Diagram (Mermaid required for ER/relationship)
9
37
 
10
38
  ```mermaid
11
39
  erDiagram
12
- USER ||--o{ ORDER : places
40
+ USER ||--o{ ORDER_DRAFT : creates
13
41
  USER {
14
42
  string id
15
43
  string email
16
44
  }
17
- ORDER {
45
+ ORDER_DRAFT {
18
46
  string id
19
47
  string user_id
48
+ string status
20
49
  }
21
50
  ```
22
-
23
- ## Notes
24
-
25
- - Keep detailed SSOT in `.qfai/contracts/**`.
26
- - Use this file as the shared contract index and relationship map.
@@ -0,0 +1,9 @@
1
+ # 08 Decisions
2
+
3
+ ## Decisions
4
+
5
+ - 0 items in shared decisions.
6
+
7
+ ## Empty State
8
+
9
+ - Add ADR entries only when a cross-spec shared decision is required.
@@ -0,0 +1,11 @@
1
+ # 09 Open Questions
2
+
3
+ ## Open Questions
4
+
5
+ | OQ-ID | Question | Owner | Due | Status | Notes |
6
+ | ------- | ---------------- | ----- | --- | ------ | ----------------------------- |
7
+ | 0 items | 0 open questions | - | - | - | Add rows only when unresolved |
8
+
9
+ ## Empty State
10
+
11
+ - 0 open questions in shared scope.
@@ -0,0 +1,9 @@
1
+ # 10 Delta
2
+
3
+ ## Change Summary
4
+
5
+ - 0 items in shared delta.
6
+
7
+ ## Empty State
8
+
9
+ - Add shared-scope decisions only when a cross-spec change requires tracking.
@@ -1,7 +1,9 @@
1
1
  # 07 Decisions
2
2
 
3
- ## ADR-0001: <title>
3
+ ## Decisions
4
4
 
5
- - Context:
6
- - Decision:
7
- - Consequences:
5
+ - 0 decisions in this spec.
6
+
7
+ ## Empty State
8
+
9
+ - Add ADR entries when a local spec decision is finalized.
@@ -1,9 +1,11 @@
1
1
  # 08 Open Questions
2
2
 
3
- ## OQ-0001: <title>
3
+ ## Open Questions
4
4
 
5
- - Status: open
6
- - Question:
7
- - Why missing:
8
- - Owner:
9
- - Due:
5
+ | OQ-ID | Question | Owner | Due | Status | Notes |
6
+ | ------- | ---------------- | ----- | --- | ------ | ----------------------------- |
7
+ | 0 items | 0 open questions | - | - | - | Add rows only when unresolved |
8
+
9
+ ## Empty State
10
+
11
+ - 0 open questions in this spec.
@@ -21,9 +21,9 @@ specs/
21
21
  │ ├── 05_Contracts.md
22
22
  │ ├── 06_Glossary.md
23
23
  │ ├── 07_Constraints.md
24
- │ ├── 08_Decisions.md (recommended)
25
- │ ├── 09_Open-questions.md (recommended)
26
- │ └── 10_delta.md (recommended)
24
+ │ ├── 08_Decisions.md
25
+ │ ├── 09_Open-questions.md
26
+ │ └── 10_delta.md
27
27
  └── spec-XXXX/
28
28
  ├── 01_Spec.md
29
29
  ├── 02_User-stories.md
@@ -31,8 +31,8 @@ specs/
31
31
  ├── 04_Business-Rules.md
32
32
  ├── 05_Examples.md
33
33
  ├── 06_Test-Cases.md
34
- ├── 07_Decisions.md (recommended)
35
- ├── 08_Open-questions.md (recommended)
34
+ ├── 07_Decisions.md
35
+ ├── 08_Open-questions.md
36
36
  ├── 09_delta.md or *_delta.md
37
37
  └── 10_Plan.md (optional, How-only)
38
38
  ```
@@ -71,5 +71,7 @@ Each `spec-XXXX/` must satisfy:
71
71
  - Gherkin is documented in `spec-XXXX/03_Acceptance-Criteria.md`.
72
72
  - If diagrams are written in discuss/require/spec/evidence artifacts, use ` ```mermaid ` fences only (do not use ` ```text ` or language-less fences).
73
73
  - Delta file accepts `09_delta.md` or any `*_delta.md`.
74
+ - `07_Decisions.md` / `08_Open-questions.md` and `_shared/08_Decisions.md` / `_shared/09_Open-questions.md` / `_shared/10_delta.md` are required even when empty.
75
+ - When empty, explicitly write `0 items` (or equivalent wording) in each file.
74
76
  - Contracts SSOT remains `.qfai/contracts/**`.
75
77
  - Report artifacts under `.qfai/report/**` are derived outputs (non-SSOT).