qfai 1.7.8 → 1.7.9
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/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +35 -6
- package/assets/init/.qfai/assistant/skills/qfai-prototyping-full-harness/SKILL.md +185 -0
- package/dist/cli/index.cjs +317 -125
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +315 -123
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +293 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +291 -99
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -42,12 +42,11 @@ QFAI Skill Body (SSOT)
|
|
|
42
42
|
|
|
43
43
|
Run prototyping as an **all-spec stage**. Scope is fixed to **ALL specs** resolved from `.qfai/specs/spec-*`.
|
|
44
44
|
|
|
45
|
-
This stage is complete only when all specs pass the minimum
|
|
45
|
+
This stage is complete only when all specs pass the minimum contract:
|
|
46
46
|
|
|
47
|
-
-
|
|
48
|
-
- API endpoints return non-404 statuses.
|
|
49
|
-
- DB objects needed for runtime are present (real DB or documented in-memory substitute).
|
|
47
|
+
- Static checks confirm declared routes, endpoints, and schema objects exist in code.
|
|
50
48
|
- Evidence is captured and validate can enforce it.
|
|
49
|
+
- Runtime verification (browser, live API) is reserved for full-harness mode only.
|
|
51
50
|
|
|
52
51
|
## Visual Review Guard
|
|
53
52
|
|
|
@@ -69,6 +68,36 @@ This stage is complete only when all specs pass the minimum runtime contract:
|
|
|
69
68
|
- If L1 fallback is chosen, record explicit user approval and rationale in evidence.
|
|
70
69
|
- Placeholder-only pages (single static string, lorem ipsum, or equivalent) are `REVISE`.
|
|
71
70
|
|
|
71
|
+
## Prototyping Modes
|
|
72
|
+
|
|
73
|
+
This skill is **static-first**: validation relies on static checks and file-based analysis by default.
|
|
74
|
+
No runtime execution (browser, live API, DB connection) is required unless full-harness mode is activated.
|
|
75
|
+
|
|
76
|
+
### Low-cost
|
|
77
|
+
|
|
78
|
+
- Static checks only: file existence, route declaration, schema presence.
|
|
79
|
+
- Suitable for L1 fidelity targets.
|
|
80
|
+
- No browser or server process needed.
|
|
81
|
+
|
|
82
|
+
### Standard
|
|
83
|
+
|
|
84
|
+
- Static checks plus optional light validation (mock data, stub handlers).
|
|
85
|
+
- Suitable for L2 fidelity targets (default).
|
|
86
|
+
- Runtime verification is NOT required; evidence is file-based.
|
|
87
|
+
|
|
88
|
+
### Full-harness
|
|
89
|
+
|
|
90
|
+
- Delegates to `/qfai-prototyping-full-harness` skill for runtime-heavy obligations.
|
|
91
|
+
- Includes browser-based UI reachability, live endpoint availability checks, and DB object verification.
|
|
92
|
+
- Suitable for L3–L5 fidelity targets.
|
|
93
|
+
- Must be explicitly opted in via `--mode full-harness` or discussion recommendation.
|
|
94
|
+
|
|
95
|
+
## Non-UI Projects
|
|
96
|
+
|
|
97
|
+
For projects with `surface: non-ui`, prototyping obligations are n/a.
|
|
98
|
+
Non-UI surfaces skip UI route checks, screen rendering, and visual fidelity gates.
|
|
99
|
+
Evidence should record `surface: non-ui` and mark UI-specific rows as n/a in the Coverage Matrix.
|
|
100
|
+
|
|
72
101
|
## FORMAT SSOT (Mandatory)
|
|
73
102
|
|
|
74
103
|
- Before writing or editing any `.qfai/**` artifact, read and follow the relevant directory README template and sample:
|
|
@@ -207,8 +236,8 @@ If facts are missing, record Open Questions and ask the user.
|
|
|
207
236
|
- If any spec has zero resolved contracts, STOP and route back to `/qfai-discussion`.
|
|
208
237
|
- Do not add ATDD/TDD automation in this stage.
|
|
209
238
|
- You MUST produce both prototyping evidence artifacts in `.qfai/evidence/`.
|
|
210
|
-
- You MUST
|
|
211
|
-
- DONE is forbidden when Coverage Matrix is incomplete or
|
|
239
|
+
- You MUST produce evidence via static checks and file-based validation.
|
|
240
|
+
- DONE is forbidden when Coverage Matrix is incomplete or static analysis detects missing endpoints.
|
|
212
241
|
|
|
213
242
|
## Completion Contract (Shared)
|
|
214
243
|
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# /qfai-prototyping-full-harness
|
|
2
|
+
|
|
3
|
+
[DRIFT-PROTOCOL:MANDATORY]
|
|
4
|
+
|
|
5
|
+
Premium prototyping skill with planner/generator/evaluator iteration loop.
|
|
6
|
+
Full-harness mode is an **explicit, non-default** path activated only via
|
|
7
|
+
`qfai prototyping --mode full-harness` or discussion artifact recommendation.
|
|
8
|
+
|
|
9
|
+
> This skill defines a real execution workflow — it is NOT a routing-only redirect.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Projects requiring L3–L5 fidelity evidence (production-ready prototypes).
|
|
14
|
+
- Evaluation needs: weighted multi-dimension scoring with decision gates.
|
|
15
|
+
- Explicit opt-in only; never auto-activated from config, env, or standard mode.
|
|
16
|
+
|
|
17
|
+
## Workflow Loop
|
|
18
|
+
|
|
19
|
+
The full-harness iteration loop proceeds through four phases per cycle:
|
|
20
|
+
|
|
21
|
+
### Planner Phase
|
|
22
|
+
|
|
23
|
+
- Generate strategy from spec constraints, budget, and prior iteration feedback.
|
|
24
|
+
- Produce a ranked plan with target dimensions, expected quality floor, and cost estimate.
|
|
25
|
+
- Constraints propagated from discussion artifact recommendation.
|
|
26
|
+
|
|
27
|
+
### Generator Phase
|
|
28
|
+
|
|
29
|
+
- Execute prototyping output production based on planner strategy.
|
|
30
|
+
- Incorporate refinement notes from prior evaluator feedback.
|
|
31
|
+
- Produce render evidence, test results, and validator output as artifacts.
|
|
32
|
+
|
|
33
|
+
### Evaluator Phase
|
|
34
|
+
|
|
35
|
+
- Apply weighted scoring across configured dimensions (floor enforcement).
|
|
36
|
+
- Decision gate: converge, refine, or pivot based on scoring-ready schema.
|
|
37
|
+
- Record scoring trace with dimension-level breakdown for auditability.
|
|
38
|
+
|
|
39
|
+
### Decision Gate
|
|
40
|
+
|
|
41
|
+
- Convergence criteria: all dimension floors met AND aggregate score above threshold.
|
|
42
|
+
- Refinement: loop back to generator with evaluator feedback.
|
|
43
|
+
- Pivot: loop back to planner with strategic reassessment.
|
|
44
|
+
- Termination: max iterations reached OR convergence achieved.
|
|
45
|
+
|
|
46
|
+
## Evidence Collection
|
|
47
|
+
|
|
48
|
+
Every full-harness run MUST produce:
|
|
49
|
+
|
|
50
|
+
- Render evidence with `captured / skipped / failed` status (3-state vocabulary).
|
|
51
|
+
- Iteration history (planner input → generator output → evaluator score per cycle).
|
|
52
|
+
- Scoring trace with dimension-level breakdown.
|
|
53
|
+
- Termination reason (converged / max-iterations / manual-stop).
|
|
54
|
+
- Validator output from `qfai validate` at each iteration.
|
|
55
|
+
|
|
56
|
+
## Reviewer Invocation
|
|
57
|
+
|
|
58
|
+
- Generate review summary at convergence or termination.
|
|
59
|
+
- Review findings must reference iteration history and scoring trace.
|
|
60
|
+
- Reviewer sign-off is a required gate before evidence is finalized.
|
|
61
|
+
|
|
62
|
+
### Reviewer Gate (MUST)
|
|
63
|
+
|
|
64
|
+
- Final completion gate MUST be delegated to an independent Reviewer sub-agent.
|
|
65
|
+
- Reviewer checks (minimum):
|
|
66
|
+
- evidence completeness and iteration history integrity,
|
|
67
|
+
- scoring trace auditability and calibration adherence,
|
|
68
|
+
- Drift Protocol was enforced,
|
|
69
|
+
- test-layer obligations match `test-layers.md` and plan,
|
|
70
|
+
- floors and ratios are **signals, not gates**.
|
|
71
|
+
- Reviewer returns only `PASS` or `REVISE`.
|
|
72
|
+
- Every `REVISE` must include a concrete alternative proposal.
|
|
73
|
+
|
|
74
|
+
## Calibration Integration
|
|
75
|
+
|
|
76
|
+
- Scoring-ready schema defines dimension weights and floor thresholds.
|
|
77
|
+
- Calibration config is read from `qfai.config.yaml` under `prototyping.calibration`.
|
|
78
|
+
- Threshold adjustments are logged in iteration history for traceability.
|
|
79
|
+
|
|
80
|
+
## Three-Mode Positioning
|
|
81
|
+
|
|
82
|
+
This skill covers **full-harness** mode only. See also:
|
|
83
|
+
|
|
84
|
+
| Mode | Scope | Skill |
|
|
85
|
+
| ---------------- | --------------------------------------- | --------------------------------------------- |
|
|
86
|
+
| **low-cost** | Static checks only (L1/L2) | `/qfai-prototyping` |
|
|
87
|
+
| **standard** | Static + optional light runtime (L2/L3) | `/qfai-prototyping` |
|
|
88
|
+
| **full-harness** | Static + runtime-heavy (L3/L4/L5) | `/qfai-prototyping-full-harness` (this skill) |
|
|
89
|
+
|
|
90
|
+
Standard and low-cost modes are handled by the standard `/qfai-prototyping` skill.
|
|
91
|
+
Full-harness adds runtime-heavy obligations: API non-404 checks, DB existence verification,
|
|
92
|
+
and UI route reachability — these are NOT imposed on standard or low-cost modes.
|
|
93
|
+
|
|
94
|
+
## Non-UI Projects
|
|
95
|
+
|
|
96
|
+
For non-UI projects (`surface: non-ui`), this skill returns n/a.
|
|
97
|
+
Full-harness obligations assume a UI-bearing surface.
|
|
98
|
+
|
|
99
|
+
## Sub-agent Delegation (MANDATORY)
|
|
100
|
+
|
|
101
|
+
This section is mandatory and overrides conflicting fallback text.
|
|
102
|
+
|
|
103
|
+
### Orchestrator Protocol (MUST)
|
|
104
|
+
|
|
105
|
+
- Orchestrator may only create work orders, delegate tasks, integrate outputs, and present results to the user.
|
|
106
|
+
- Orchestrator MUST NOT generate the primary artifact first draft.
|
|
107
|
+
- Orchestrator MUST NOT serve as Reviewer or skip delegation for convenience.
|
|
108
|
+
|
|
109
|
+
### Capability Probe (MUST)
|
|
110
|
+
|
|
111
|
+
1. Run one harmless Probe Task (for example: "reply with ok") once at stage start.
|
|
112
|
+
2. If subagents are unavailable, explicitly ask the user for Simulation mode approval.
|
|
113
|
+
3. Without explicit approval, stop the stage.
|
|
114
|
+
|
|
115
|
+
### Simulation mode (Opt-in only)
|
|
116
|
+
|
|
117
|
+
- Allowed only when the user explicitly states `Simulation mode allowed`.
|
|
118
|
+
- Record both in evidence:
|
|
119
|
+
- `Subagents: simulated (reason: <why unavailable>)`
|
|
120
|
+
- `User approval: <quote or reference>`
|
|
121
|
+
|
|
122
|
+
## Work Orders Summary
|
|
123
|
+
|
|
124
|
+
Every major artifact in this stage MUST include this table:
|
|
125
|
+
|
|
126
|
+
| Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
|
|
127
|
+
| ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- |
|
|
128
|
+
| 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
|
|
129
|
+
|
|
130
|
+
## CRITICAL CONSTRAINTS (Read First)
|
|
131
|
+
|
|
132
|
+
- Scope is full-harness prototyping only — do not run standard/low-cost validation.
|
|
133
|
+
- Contracts are strict inputs in this stage.
|
|
134
|
+
- Runtime checks are mandatory for this mode (UI reachability, endpoint liveness, DB presence).
|
|
135
|
+
- Evidence must capture iteration-level detail including scoring traces.
|
|
136
|
+
- DONE is forbidden when iteration loop has not converged or max-iterations is not reached.
|
|
137
|
+
|
|
138
|
+
## Completion Contract (Shared)
|
|
139
|
+
|
|
140
|
+
Before declaring completion, you MUST:
|
|
141
|
+
|
|
142
|
+
- resolve or explicitly defer ambiguous items,
|
|
143
|
+
- verify every required artifact exists and is complete,
|
|
144
|
+
- scan outputs for placeholders (TBD/TODO/OPEN QUESTION and equivalents),
|
|
145
|
+
- run the smallest executable smoke proof and record outcomes.
|
|
146
|
+
|
|
147
|
+
## Evidence (MANDATORY)
|
|
148
|
+
|
|
149
|
+
Create/update both artifacts in `.qfai/evidence/`:
|
|
150
|
+
|
|
151
|
+
1. Markdown evidence with sections:
|
|
152
|
+
- Iteration History (planner/generator/evaluator per cycle)
|
|
153
|
+
- Scoring Trace (dimension-level breakdown)
|
|
154
|
+
- Termination Reason
|
|
155
|
+
- Work Orders Summary
|
|
156
|
+
2. JSON evidence with minimum fields:
|
|
157
|
+
- `iterations[]` with per-cycle scoring and decision
|
|
158
|
+
- `meta.generatedAt`, `meta.toolVersion`, `meta.commands[]`
|
|
159
|
+
|
|
160
|
+
## FINAL CHECKLIST (Check Last)
|
|
161
|
+
|
|
162
|
+
- [ ] All iteration cycles are recorded with scoring traces.
|
|
163
|
+
- [ ] Convergence or termination condition was met.
|
|
164
|
+
- [ ] Reviewer returned PASS.
|
|
165
|
+
- [ ] Evidence artifacts are updated.
|
|
166
|
+
- [ ] `qfai validate --fail-on error` passes.
|
|
167
|
+
|
|
168
|
+
## Completion Checklist (MUST)
|
|
169
|
+
|
|
170
|
+
- [ ] This skill's Definition of Done is satisfied.
|
|
171
|
+
- [ ] Required artifacts were produced or updated.
|
|
172
|
+
- [ ] Open questions were logged when needed.
|
|
173
|
+
- [ ] Completion message was presented to the user.
|
|
174
|
+
- [ ] Next actions were enumerated.
|
|
175
|
+
|
|
176
|
+
## Completion Message & Next Actions (MUST)
|
|
177
|
+
|
|
178
|
+
When complete, provide a final user-facing completion message and list actions.
|
|
179
|
+
|
|
180
|
+
- Proceed (recommended): `/qfai-atdd`.
|
|
181
|
+
Action: implement acceptance tests against the full-harness prototype.
|
|
182
|
+
- Quality gate run: `/qfai-verify`.
|
|
183
|
+
Action: run full validation/report flow and publish gate evidence.
|
|
184
|
+
- Rework prototyping: rerun `/qfai-prototyping-full-harness`.
|
|
185
|
+
Action: fix convergence failures or scoring trace gaps.
|