qfai 1.0.5 → 1.0.7
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 +274 -250
- package/assets/init/.qfai/README.md +4 -3
- package/assets/init/.qfai/assistant/agents/README.md +2 -0
- package/assets/init/.qfai/assistant/agents/contract-designer.md +1 -1
- package/assets/init/.qfai/assistant/instructions/README.md +5 -1
- package/assets/init/.qfai/assistant/instructions/agent-selection.md +28 -0
- package/assets/init/.qfai/assistant/instructions/communication.md +27 -0
- package/assets/init/.qfai/assistant/instructions/quality.md +27 -0
- package/assets/init/.qfai/assistant/instructions/thinking.md +29 -0
- package/assets/init/.qfai/assistant/prompts/README.md +1 -1
- package/assets/init/.qfai/assistant/prompts/qfai-configure.md +174 -0
- package/assets/init/.qfai/assistant/prompts/qfai-implement.md +0 -9
- package/assets/init/.qfai/assistant/prompts/qfai-pr.md +0 -9
- package/assets/init/.qfai/assistant/prompts/qfai-require.md +0 -9
- package/assets/init/.qfai/assistant/prompts/qfai-scenario-test.md +0 -9
- package/assets/init/.qfai/assistant/prompts/qfai-spec.md +14 -10
- package/assets/init/.qfai/assistant/prompts/qfai-unit-test.md +0 -9
- package/assets/init/.qfai/assistant/prompts/qfai-verify.md +0 -9
- package/assets/init/.qfai/assistant/prompts.local/README.md +2 -0
- package/assets/init/.qfai/assistant/steering/README.md +7 -0
- package/assets/init/.qfai/contracts/README.md +1 -1
- package/assets/init/.qfai/contracts/db/README.md +21 -4
- package/assets/init/.qfai/specs/README.md +2 -0
- package/assets/init/root/.claude/commands/qfai-configure.md +14 -0
- package/assets/init/root/.claude/commands/qfai-discuss.md +14 -0
- package/assets/init/root/.claude/commands/qfai-implement.md +14 -0
- package/assets/init/root/.claude/commands/qfai-require.md +14 -0
- package/assets/init/root/.claude/commands/qfai-scenario-test.md +14 -0
- package/assets/init/root/.claude/commands/qfai-spec.md +14 -0
- package/assets/init/root/.claude/commands/qfai-unit-test.md +14 -0
- package/assets/init/root/.claude/commands/qfai-verify.md +14 -0
- package/assets/init/root/.codex/README.md +16 -0
- package/assets/init/root/.codex/skills/qfai-configure/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-discuss/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-implement/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-require/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-scenario-test/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-spec/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-unit-test/SKILL.md +18 -0
- package/assets/init/root/.codex/skills/qfai-verify/SKILL.md +18 -0
- package/assets/init/root/.github/copilot-instructions.md +14 -0
- package/assets/init/root/.github/prompts/qfai-configure.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-discuss.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-implement.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-require.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-scenario-test.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-spec.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-unit-test.prompt.md +17 -0
- package/assets/init/root/.github/prompts/qfai-verify.prompt.md +17 -0
- package/dist/cli/index.cjs +10 -4
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +10 -4
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/assets/init/root/tests/qfai-traceability.sample.test.ts +0 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: quality
|
|
3
|
+
category: universal
|
|
4
|
+
update_frequency: occasional
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Quality (Gates, tests, and safety)
|
|
8
|
+
|
|
9
|
+
## Quality gates (baseline)
|
|
10
|
+
|
|
11
|
+
When code changes are requested, the expected minimum gates are:
|
|
12
|
+
|
|
13
|
+
- `pnpm format:check`
|
|
14
|
+
- `pnpm lint`
|
|
15
|
+
- `pnpm check-types`
|
|
16
|
+
- `pnpm test`
|
|
17
|
+
- `pnpm verify:pack` (when publishing/distribution matters)
|
|
18
|
+
|
|
19
|
+
## Do not weaken safety nets
|
|
20
|
+
|
|
21
|
+
- Do not suppress or disable checks via inline ignores unless explicitly approved.
|
|
22
|
+
- If a rule must be changed, justify with evidence and update tests/docs accordingly.
|
|
23
|
+
|
|
24
|
+
## Testing expectations
|
|
25
|
+
|
|
26
|
+
- Prefer adding/adjusting tests over weakening validation.
|
|
27
|
+
- Keep outputs deterministic (avoid time/randomness).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: thinking
|
|
3
|
+
category: universal
|
|
4
|
+
update_frequency: rare
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Thinking (Evidence-first, ambiguity elimination)
|
|
8
|
+
|
|
9
|
+
## Principles
|
|
10
|
+
|
|
11
|
+
- Prefer **repo evidence** over assumptions (file paths, configs, tests, commands).
|
|
12
|
+
- If something cannot be verified, write `TBD` and raise an Open Question (what evidence is missing).
|
|
13
|
+
- Minimize ambiguity: define terms, scope, and measurable acceptance criteria.
|
|
14
|
+
|
|
15
|
+
## Working method
|
|
16
|
+
|
|
17
|
+
1. Restate the goal and constraints (brief).
|
|
18
|
+
2. Enumerate unknowns and assumptions.
|
|
19
|
+
3. Identify the evidence to check (files/commands).
|
|
20
|
+
4. Decide with a rationale grounded in evidence.
|
|
21
|
+
5. Record residual risk and the rollback path.
|
|
22
|
+
|
|
23
|
+
## When to stop and ask
|
|
24
|
+
|
|
25
|
+
Stop and ask the user if:
|
|
26
|
+
|
|
27
|
+
- required inputs are missing (e.g., target behavior, API shape, UX intent),
|
|
28
|
+
- multiple interpretations are plausible and impact is material,
|
|
29
|
+
- a change could be breaking and intent is unclear.
|
|
@@ -10,10 +10,10 @@ Rule:
|
|
|
10
10
|
Files:
|
|
11
11
|
|
|
12
12
|
- qfai-discuss.md (optional)
|
|
13
|
+
- qfai-configure.md (run after init; updates qfai.config.yaml testFileGlobs; outputs updated YAML + validation checklist)
|
|
13
14
|
- qfai-require.md
|
|
14
15
|
- qfai-spec.md
|
|
15
16
|
- qfai-scenario-test.md
|
|
16
17
|
- qfai-unit-test.md
|
|
17
18
|
- qfai-implement.md
|
|
18
19
|
- qfai-verify.md
|
|
19
|
-
- qfai-pr.md (optional)
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
QFAI Prompt Body (SSOT)
|
|
3
|
+
- This file is intended to be referenced by tool-specific custom prompt definitions (e.g., Copilot .prompt.md, Claude Code slash commands).
|
|
4
|
+
- Keep tool-specific wrappers thin: "Read this file and follow it."
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
id: qfai-configure
|
|
10
|
+
title: QFAI Configure (Tune qfai.config.yaml)
|
|
11
|
+
description: "Analyze the repository and tune qfai.config.yaml (testFileGlobs, exclude globs)."
|
|
12
|
+
argument-hint: "[--auto]"
|
|
13
|
+
allowed-tools: [Read, Glob, Write, TodoWrite, Task]
|
|
14
|
+
roles: [DevOpsCIEngineer, QAEngineer, CodeReviewer, Planner]
|
|
15
|
+
mode: evidence-focused
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# /qfai-configure - Configure QFAI for this repository
|
|
20
|
+
|
|
21
|
+
## Purpose
|
|
22
|
+
|
|
23
|
+
Analyze the repository and update `qfai.config.yaml` so QFAI traceability checks (especially SC->Test) are actionable without manual tuning.
|
|
24
|
+
|
|
25
|
+
## Success Criteria (Definition of Done)
|
|
26
|
+
|
|
27
|
+
- `qfai.config.yaml` is updated with a **minimal diff** focused on traceability globs.
|
|
28
|
+
- `validation.traceability.testFileGlobs` reflects the real test layout.
|
|
29
|
+
- `validation.traceability.testFileExcludeGlobs` is added only when needed.
|
|
30
|
+
- A validation checklist with evidence (sample matched files) is produced.
|
|
31
|
+
|
|
32
|
+
## Non-Negotiable Principles (QFAI Articles)
|
|
33
|
+
|
|
34
|
+
These principles are inspired by "constitution / articles" patterns used by other agent frameworks, but tailored to QFAI.
|
|
35
|
+
|
|
36
|
+
1. **SDD First (Specification is the source of truth)**
|
|
37
|
+
If there is a conflict between code and spec, treat the spec as authoritative and either (a) fix code or (b) raise an explicit Open Question to change the spec.
|
|
38
|
+
|
|
39
|
+
2. **Traceability is mandatory**
|
|
40
|
+
Every meaningful change must be traceable: **Require -> Spec -> Scenario -> Tests -> Code -> Verification evidence**.
|
|
41
|
+
|
|
42
|
+
3. **Evidence over confidence**
|
|
43
|
+
Prefer observable proof (logs, commands, file diffs, test results). If you cannot verify, say so and record it.
|
|
44
|
+
|
|
45
|
+
4. **Minimize scope, but never hide gaps**
|
|
46
|
+
Keep changes minimal, but do not "paper over" missing decisions. If something blocks correctness, stop and ask.
|
|
47
|
+
|
|
48
|
+
5. **Quality gates are the decision mechanism**
|
|
49
|
+
Use tests/lint/typecheck/build/pack verification (whatever the repo defines) as the primary guardrail. Fix until PASS.
|
|
50
|
+
|
|
51
|
+
6. **Make it runnable**
|
|
52
|
+
Outputs must be executable in terminal/CI. Provide copy-paste commands.
|
|
53
|
+
|
|
54
|
+
7. **User time is expensive**
|
|
55
|
+
Ask only the questions that are truly blocking. Everything else: make reasonable assumptions and label them clearly.
|
|
56
|
+
|
|
57
|
+
## Absolute Rule - Output Language
|
|
58
|
+
|
|
59
|
+
**All outputs MUST be written in the user's working language for this session.**
|
|
60
|
+
|
|
61
|
+
- If the user writes in Japanese, output Japanese.
|
|
62
|
+
- If the user writes in English, output English.
|
|
63
|
+
- If the user mixes languages, prefer the dominant language unless explicitly instructed otherwise.
|
|
64
|
+
This rule overrides all other stylistic preferences.
|
|
65
|
+
|
|
66
|
+
## Multi-Role Orchestration (Subagents)
|
|
67
|
+
|
|
68
|
+
This workflow assumes the environment _may_ support subagents (e.g., Claude Code "Task" tool) or may not.
|
|
69
|
+
|
|
70
|
+
### If subagents are supported
|
|
71
|
+
|
|
72
|
+
Delegate to multiple roles and then merge the results. Use a "real-world workflow" order:
|
|
73
|
+
|
|
74
|
+
- Facilitator -> Interviewer -> Requirements Analyst -> Planner -> Architect -> (Contract Designer) -> Test Engineer -> QA Engineer -> Code Reviewer -> DevOps/CI Engineer
|
|
75
|
+
|
|
76
|
+
**Pseudo-invocation pattern** (adjust to your tool):
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
Task(
|
|
80
|
+
subagent_type="planner",
|
|
81
|
+
description="Analyze repo and propose testFileGlobs",
|
|
82
|
+
prompt="Context: ...\nGoal: Tune qfai.config.yaml\nConstraints: minimal diff\nReturn: globs + evidence"
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### If subagents are NOT supported
|
|
87
|
+
|
|
88
|
+
Simulate roles by running the same sequence yourself:
|
|
89
|
+
|
|
90
|
+
- Write a short "role output" section per role, then consolidate into the final deliverable(s).
|
|
91
|
+
|
|
92
|
+
## Constraints
|
|
93
|
+
|
|
94
|
+
- Only update `qfai.config.yaml` unless explicitly asked.
|
|
95
|
+
- Do **not** modify tests or source code.
|
|
96
|
+
- Avoid overly broad globs (e.g., `**/*`).
|
|
97
|
+
- Exclude generated/output directories (`node_modules`, `.git`, `.qfai`, `dist`, `build`, `coverage`, `.next`, `out`, etc.).
|
|
98
|
+
|
|
99
|
+
## Step 0 - Load Context (always)
|
|
100
|
+
|
|
101
|
+
1. Read relevant **project steering** (if present):
|
|
102
|
+
- `.qfai/assistant/steering/structure.md`
|
|
103
|
+
- `.qfai/assistant/steering/tech.md`
|
|
104
|
+
- `.qfai/assistant/steering/product.md`
|
|
105
|
+
- any additional files under `.qfai/assistant/steering/`
|
|
106
|
+
|
|
107
|
+
2. Read **project constitution / instructions** (if present):
|
|
108
|
+
- `.qfai/assistant/instructions/constitution.md`
|
|
109
|
+
- `.qfai/assistant/instructions/workflow.md` (or equivalent)
|
|
110
|
+
|
|
111
|
+
3. Inspect repo conventions:
|
|
112
|
+
- package manager (pnpm/npm/yarn), test runner, lint/typecheck scripts, CI definitions
|
|
113
|
+
- existing test patterns (unit/integration/e2e)
|
|
114
|
+
|
|
115
|
+
## Step 0 - Project Analysis (mandatory)
|
|
116
|
+
|
|
117
|
+
Before editing config, **thoroughly analyze the current project**:
|
|
118
|
+
|
|
119
|
+
- background and goals
|
|
120
|
+
- directory structure and conventions
|
|
121
|
+
- chosen technologies and versions (runtime, package manager, test runner)
|
|
122
|
+
- test locations (unit/integration/e2e)
|
|
123
|
+
- existing test naming rules (`*.test.*`, `*.spec.*`, `*_test.*`, etc.)
|
|
124
|
+
|
|
125
|
+
If analysis cannot be performed (missing access), clearly state what could not be verified and proceed with minimal-risk assumptions.
|
|
126
|
+
|
|
127
|
+
## Step 1 - Identify test frameworks and locations
|
|
128
|
+
|
|
129
|
+
1. Inspect `package.json` and config files (e.g., `vitest.config.*`, `jest.config.*`, `playwright.config.*`, `pytest.ini`, `go.mod`).
|
|
130
|
+
2. Enumerate directories that contain tests (e.g., `tests/`, `src/`, `e2e/`, `integration/`).
|
|
131
|
+
3. Note naming rules and extensions that indicate test files.
|
|
132
|
+
|
|
133
|
+
## Step 2 - Propose glob patterns
|
|
134
|
+
|
|
135
|
+
Provide 3-10 **include globs** that cover all known test locations:
|
|
136
|
+
|
|
137
|
+
- Prefer explicit patterns (e.g., `src/**/*.test.ts`, `tests/**/*.spec.ts`).
|
|
138
|
+
- Include src-colocated tests if they exist.
|
|
139
|
+
|
|
140
|
+
Provide **exclude globs** only when necessary (beyond the default exclusions).
|
|
141
|
+
|
|
142
|
+
## Step 3 - Update `qfai.config.yaml` (minimal diff)
|
|
143
|
+
|
|
144
|
+
Edit:
|
|
145
|
+
|
|
146
|
+
- `validation.traceability.testFileGlobs`
|
|
147
|
+
- `validation.traceability.testFileExcludeGlobs` (only if needed)
|
|
148
|
+
|
|
149
|
+
Keep all other config keys unchanged.
|
|
150
|
+
|
|
151
|
+
## Step 4 - Evidence sampling
|
|
152
|
+
|
|
153
|
+
Sample 5-15 actual test files that match the proposed globs.
|
|
154
|
+
|
|
155
|
+
- If zero matches exist, stop and ask for clarification.
|
|
156
|
+
- If some directories are ambiguous, list them as Open Questions.
|
|
157
|
+
|
|
158
|
+
## Checkpoints
|
|
159
|
+
|
|
160
|
+
- [ ] Repository analysis completed (frameworks, test layout, naming rules).
|
|
161
|
+
- [ ] Proposed include/exclude globs with rationale.
|
|
162
|
+
- [ ] `qfai.config.yaml` updated (minimal diff).
|
|
163
|
+
- [ ] Evidence: sample matched files listed.
|
|
164
|
+
|
|
165
|
+
## Output
|
|
166
|
+
|
|
167
|
+
Provide:
|
|
168
|
+
|
|
169
|
+
1. Updated `qfai.config.yaml` (diff or full file, as appropriate).
|
|
170
|
+
2. A short summary of changes and rationale.
|
|
171
|
+
3. Validation checklist with sampled files.
|
|
172
|
+
4. Open questions (blocking vs non-blocking).
|
|
173
|
+
|
|
174
|
+
Suggest next step: `/qfai-require` (or `/qfai-discuss` if requirements are not ready).
|
|
@@ -89,15 +89,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
89
89
|
|
|
90
90
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
91
91
|
|
|
92
|
-
## Behavior Rules (high leverage)
|
|
93
|
-
|
|
94
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
95
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
96
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
97
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
98
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
99
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
100
|
-
|
|
101
92
|
## Step 0 — Load Context (always)
|
|
102
93
|
|
|
103
94
|
1. Read relevant **project steering** (if present):
|
|
@@ -92,15 +92,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
92
92
|
|
|
93
93
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
94
94
|
|
|
95
|
-
## Behavior Rules (high leverage)
|
|
96
|
-
|
|
97
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
98
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
99
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
100
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
101
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
102
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
103
|
-
|
|
104
95
|
## Step 0 — Load Context (always)
|
|
105
96
|
|
|
106
97
|
1. Read relevant **project steering** (if present):
|
|
@@ -88,15 +88,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
88
88
|
|
|
89
89
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
90
90
|
|
|
91
|
-
## Behavior Rules (high leverage)
|
|
92
|
-
|
|
93
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
94
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
95
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
96
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
97
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
98
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
99
|
-
|
|
100
91
|
## Step 0 — Load Context (always)
|
|
101
92
|
|
|
102
93
|
1. Read relevant **project steering** (if present):
|
|
@@ -88,15 +88,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
88
88
|
|
|
89
89
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
90
90
|
|
|
91
|
-
## Behavior Rules (high leverage)
|
|
92
|
-
|
|
93
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
94
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
95
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
96
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
97
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
98
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
99
|
-
|
|
100
91
|
## Step 0 — Load Context (always)
|
|
101
92
|
|
|
102
93
|
1. Read relevant **project steering** (if present):
|
|
@@ -91,15 +91,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
91
91
|
|
|
92
92
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
93
93
|
|
|
94
|
-
## Behavior Rules (high leverage)
|
|
95
|
-
|
|
96
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
97
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
98
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
99
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
100
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
101
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
102
|
-
|
|
103
94
|
## Step 0 — Load Context (always)
|
|
104
95
|
|
|
105
96
|
1. Read relevant **project steering** (if present):
|
|
@@ -262,7 +253,20 @@ Only create contracts when the spec requires a stable interface definition.
|
|
|
262
253
|
|
|
263
254
|
If your repo defines contract schema or naming rules, follow them. Otherwise:
|
|
264
255
|
|
|
265
|
-
-
|
|
256
|
+
- **UI / API contracts:** write **YAML** and include “Purpose / Fields / Constraints / Examples” as YAML comments.
|
|
257
|
+
- **DB contracts:** write **SQL (`.sql`)** and include a small header comment block, then representative DDL/schema notes.
|
|
258
|
+
|
|
259
|
+
DB contract default conventions (unless your repo defines others):
|
|
260
|
+
|
|
261
|
+
- Filename: `db-0001-<slug>.sql`
|
|
262
|
+
- Header (must):
|
|
263
|
+
```sql
|
|
264
|
+
-- QFAI-CONTRACT-ID: DB-0001
|
|
265
|
+
-- Purpose: <what this schema contract guarantees>
|
|
266
|
+
-- Constraints: <keys, nullability, ranges, invariants>
|
|
267
|
+
-- Examples: <optional example rows or queries>
|
|
268
|
+
```
|
|
269
|
+
- Body: DDL or schema notes that tests/scenarios can validate (minimal, spec-driven).
|
|
266
270
|
|
|
267
271
|
## Step 4 — QA + Review
|
|
268
272
|
|
|
@@ -88,15 +88,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
88
88
|
|
|
89
89
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
90
90
|
|
|
91
|
-
## Behavior Rules (high leverage)
|
|
92
|
-
|
|
93
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
94
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
95
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
96
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
97
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
98
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
99
|
-
|
|
100
91
|
## Step 0 — Load Context (always)
|
|
101
92
|
|
|
102
93
|
1. Read relevant **project steering** (if present):
|
|
@@ -88,15 +88,6 @@ Simulate roles by running the same sequence yourself:
|
|
|
88
88
|
|
|
89
89
|
- Write a short “role output” section per role, then consolidate into the final deliverable(s).
|
|
90
90
|
|
|
91
|
-
## Behavior Rules (high leverage)
|
|
92
|
-
|
|
93
|
-
- **Language**: Output MUST follow the user’s working language for this session.
|
|
94
|
-
- **Question budget**: Ask at most **5** clarifying questions total. Prioritize blockers. If `--auto`, proceed with explicit assumptions.
|
|
95
|
-
- **No hallucination**: Do not invent file paths, commands, or policies. Confirm via repo inspection.
|
|
96
|
-
- **Evidence**: Do not claim completion without commands/results (format/lint/type/test/pack as applicable).
|
|
97
|
-
- **Subagent contract**: When delegating, require the subagent response structure:
|
|
98
|
-
1. Findings 2) Recommendations 3) Proposed edits 4) Open Questions/Risks 5) Confidence
|
|
99
|
-
|
|
100
91
|
## Step 0 — Load Context (always)
|
|
101
92
|
|
|
102
93
|
1. Read relevant **project steering** (if present):
|
|
@@ -4,3 +4,5 @@ Optional per-project overrides.
|
|
|
4
4
|
|
|
5
5
|
If a file with the same name exists here (e.g., `qfai-spec.md`), a tool wrapper may prefer it to customize behavior for this repo.
|
|
6
6
|
Keep overrides minimal; prefer updating steering/instructions instead.
|
|
7
|
+
|
|
8
|
+
Note: After `qfai init`, this folder contains only this README. Place an override file here only when you intentionally diverge from the SSOT prompt bodies.
|
|
@@ -31,3 +31,10 @@ Steering MUST be grounded in repo evidence. When possible, include:
|
|
|
31
31
|
- directory anchors (e.g., `packages/qfai/src/cli`)
|
|
32
32
|
|
|
33
33
|
If a fact cannot be verified, mark it as `TBD` and record what evidence is missing.
|
|
34
|
+
|
|
35
|
+
### Default AI-managed flow (recommended)
|
|
36
|
+
|
|
37
|
+
1. Run a QFAI command (e.g., `/qfai-require`, `/qfai-spec`, `/qfai-implement`).
|
|
38
|
+
2. The agent loads `steering/*` and fills missing placeholders from **repo evidence**.
|
|
39
|
+
3. If evidence is missing, write `TBD` and add an Open Question (what evidence is required).
|
|
40
|
+
4. Optionally, review changes via PR if your team requires human approval.
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
# contracts/db/
|
|
2
2
|
|
|
3
|
-
Place DB contracts here (
|
|
3
|
+
Place **DB contracts** here as **SQL DDL files** (`.sql`).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## File naming
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- `db-0001-<slug>.sql`
|
|
8
|
+
- Contract ID: `DB-0001` (4-digit fixed)
|
|
9
|
+
|
|
10
|
+
## Required header
|
|
11
|
+
|
|
12
|
+
Include the contract ID in the SQL header comments so QFAI can discover/index it:
|
|
13
|
+
|
|
14
|
+
```sql
|
|
15
|
+
-- QFAI-CONTRACT-ID: DB-0001
|
|
16
|
+
-- DB-0001 (short description)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Guidelines
|
|
20
|
+
|
|
21
|
+
- Keep DB contracts minimal and spec-driven (only what scenarios/tests need).
|
|
22
|
+
- This directory is for the **contract/schema snapshot**, not migrations history.
|
|
23
|
+
- If your project uses an ORM schema (Prisma, etc.), decide one:
|
|
24
|
+
- (Recommended for v1.0.6) Keep a minimal `.sql` contract snapshot here, and link to the real schema in the spec.
|
|
25
|
+
- (Future) Add support for other schema formats via config (out of scope for v1.0.6).
|
|
@@ -7,3 +7,5 @@ A **spec pack** lives under `specs/spec-XXXX/` and contains:
|
|
|
7
7
|
- `scenario.feature` : Gherkin scenarios (ATDD skeleton)
|
|
8
8
|
|
|
9
9
|
Create/update spec packs with `/qfai-spec`.
|
|
10
|
+
|
|
11
|
+
Note: After `qfai init`, this folder contains only this README. Spec packs (`spec-XXXX/`) are created by running `/qfai-spec`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Configure qfai.config.yaml based on the repository"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-configure.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Discuss an idea and clarify requirements"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-discuss.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Implement code changes with tests"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-implement.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Create requirements artifacts"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-require.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Implement acceptance tests from scenarios"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-scenario-test.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Create specs, contracts, and scenarios"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-spec.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Implement unit tests from specs/scenarios"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-unit-test.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "QFAI: Run quality gates and produce evidence"
|
|
3
|
+
argument-hint: "[optional notes]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow the canonical QFAI prompt exactly:
|
|
7
|
+
@.qfai/assistant/prompts/qfai-verify.md
|
|
8
|
+
|
|
9
|
+
Follow the DoD/Checkpoints in the prompt.
|
|
10
|
+
Use the repository as the source of truth.
|
|
11
|
+
|
|
12
|
+
Additional user notes: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Critical: output must match the user's language.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# QFAI Codex skills
|
|
2
|
+
|
|
3
|
+
This directory provides thin Codex skill wrappers for QFAI prompts.
|
|
4
|
+
|
|
5
|
+
## Canonical prompts
|
|
6
|
+
|
|
7
|
+
The source of truth is always the prompt body under:
|
|
8
|
+
|
|
9
|
+
- .qfai/assistant/prompts/
|
|
10
|
+
|
|
11
|
+
If there is any mismatch, the canonical `.qfai` prompt wins.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
In Codex CLI, select a skill by name (e.g., `qfai-configure`) and provide your request.
|
|
16
|
+
All outputs must match the user's language.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qfai-configure
|
|
3
|
+
description: QFAI: Configure qfai.config.yaml based on the repository
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
This skill is a thin wrapper that forwards to the canonical QFAI prompt in this repository:
|
|
7
|
+
|
|
8
|
+
- .qfai/assistant/prompts/qfai-configure.md
|
|
9
|
+
|
|
10
|
+
How to invoke (Codex CLI):
|
|
11
|
+
|
|
12
|
+
- Select the `qfai-configure` skill, or reference it by name and provide your request.
|
|
13
|
+
|
|
14
|
+
Instructions:
|
|
15
|
+
|
|
16
|
+
1. Read the prompt above and follow it precisely.
|
|
17
|
+
2. Use the repository as the source of truth (tools, frameworks, directory structure).
|
|
18
|
+
3. Ensure all outputs match the user's language.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qfai-discuss
|
|
3
|
+
description: QFAI: Discuss an idea and clarify requirements
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
This skill is a thin wrapper that forwards to the canonical QFAI prompt in this repository:
|
|
7
|
+
|
|
8
|
+
- .qfai/assistant/prompts/qfai-discuss.md
|
|
9
|
+
|
|
10
|
+
How to invoke (Codex CLI):
|
|
11
|
+
|
|
12
|
+
- Select the `qfai-discuss` skill, or reference it by name and provide your request.
|
|
13
|
+
|
|
14
|
+
Instructions:
|
|
15
|
+
|
|
16
|
+
1. Read the prompt above and follow it precisely.
|
|
17
|
+
2. Use the repository as the source of truth (tools, frameworks, directory structure).
|
|
18
|
+
3. Ensure all outputs match the user's language.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qfai-implement
|
|
3
|
+
description: QFAI: Implement code changes with tests
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
This skill is a thin wrapper that forwards to the canonical QFAI prompt in this repository:
|
|
7
|
+
|
|
8
|
+
- .qfai/assistant/prompts/qfai-implement.md
|
|
9
|
+
|
|
10
|
+
How to invoke (Codex CLI):
|
|
11
|
+
|
|
12
|
+
- Select the `qfai-implement` skill, or reference it by name and provide your request.
|
|
13
|
+
|
|
14
|
+
Instructions:
|
|
15
|
+
|
|
16
|
+
1. Read the prompt above and follow it precisely.
|
|
17
|
+
2. Use the repository as the source of truth (tools, frameworks, directory structure).
|
|
18
|
+
3. Ensure all outputs match the user's language.
|