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
package/README.md
CHANGED
|
@@ -1,294 +1,318 @@
|
|
|
1
|
-
# QFAI
|
|
1
|
+
# QFAI (Quality-First AI)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://nodejs.org/)
|
|
3
|
+
QFAI is a quality-first development kit for AI coding agents.
|
|
4
|
+
Its purpose is to improve the quality of AI-generated software outputs by enforcing a structured workflow and validating traceability.
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
Modern AI coding agents can write code quickly, but they can also misunderstand requirements, drift from intended behavior, or “sound correct” while being wrong.
|
|
7
|
+
QFAI addresses these failure modes by standardizing an end-to-end delivery loop and forcing objective checks.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- SDD clarifies what to build, so the agent does not invent requirements while coding.
|
|
10
|
+
- ATDD defines acceptance goals as executable scenarios, so correctness is measured rather than assumed.
|
|
11
|
+
- TDD enables a self-correcting loop: implement → run tests → fix → repeat.
|
|
12
|
+
- Traceability validation enforces that SDD → ATDD → TDD → implementation stays aligned, reducing hallucination-driven drift.
|
|
13
|
+
- Result: higher output quality, fewer review cycles, and lower human supervision cost.
|
|
10
14
|
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
- [機能](#できること)
|
|
14
|
-
- [CLI リファレンス](#使い方cli)
|
|
15
|
-
- [設定](#設定)
|
|
16
|
-
- [契約](#契約contracts)
|
|
17
|
-
- [Monorepo 対応](#monorepo--サブディレクトリ)
|
|
18
|
-
- [CI 統合](#ci-と-hard-gate)
|
|
19
|
-
- [GitHub Actions](#github-actions-テンプレート)
|
|
20
|
-
- [開発](#開発)
|
|
21
|
-
- [ライセンス](#ライセンス)
|
|
15
|
+
QFAI is designed for a prompt-driven operating model: engineers select a prepared custom prompt and provide only the task intent.
|
|
16
|
+
The agent reads the repository, produces the required artifacts, and iterates until the hard gates pass.
|
|
22
17
|
|
|
23
|
-
##
|
|
18
|
+
## Quick start
|
|
24
19
|
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
または
|
|
30
|
-
|
|
31
|
-
```sh
|
|
20
|
+
```bash
|
|
21
|
+
# 1) Initialize QFAI assets in your repository
|
|
32
22
|
npx qfai init
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
pnpm の場合(推奨):
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
pnpm add -D qfai
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**必要環境**: Node.js >= 18.0.0(Supported) / Tested: Node.js 18, 20 / Recommended: Node.js 20 LTS 以上
|
|
42
23
|
|
|
43
|
-
|
|
24
|
+
# 2) Validate traceability (use this in CI as a hard gate)
|
|
25
|
+
npx qfai validate
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Quick Start(最短成功)
|
|
48
|
-
|
|
49
|
-
```sh
|
|
50
|
-
npx qfai init
|
|
51
|
-
npx qfai doctor --fail-on error
|
|
52
|
-
npx qfai validate --fail-on error --format github
|
|
27
|
+
# 3) Generate a human-readable report (Markdown)
|
|
53
28
|
npx qfai report
|
|
54
29
|
```
|
|
55
30
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
- `npx qfai init`
|
|
59
|
-
-
|
|
60
|
-
- `npx qfai validate`
|
|
61
|
-
-
|
|
62
|
-
- `npx qfai report`
|
|
31
|
+
## What you can do (CLI commands)
|
|
32
|
+
|
|
33
|
+
- `npx qfai init`
|
|
34
|
+
- Creates the QFAI workspace under `.qfai/` (requirements/specs/contracts/report) and installs the AI assistant kit (`assistant/` with prompts, instructions, agents, and steering templates), plus a default GitHub Actions workflow and `qfai.config.yaml`.
|
|
35
|
+
- `npx qfai validate`
|
|
36
|
+
- Validates specs/contracts/scenarios/traceability and writes `.qfai/report/validate.json`; use `--fail-on error` (or `--fail-on warning`) to turn it into a CI gate, and `--format github` to emit GitHub-friendly annotations.
|
|
37
|
+
- `npx qfai report`
|
|
38
|
+
- Produces a human-readable report (`report.md` by default) or an internal JSON export (`report.json`) from `validate.json`; use `--base-url` to link file paths in Markdown to your repository viewer.
|
|
39
|
+
- `npx qfai doctor`
|
|
40
|
+
- Diagnoses configuration discovery, path resolution, glob scanning, and `validate.json` inputs before running validate/report; use `--fail-on` to enforce failures in CI.
|
|
41
|
+
|
|
42
|
+
## Operating model (prompt-driven workflow)
|
|
43
|
+
|
|
44
|
+
QFAI assumes you operate the project primarily via prepared custom prompts.
|
|
45
|
+
A custom prompt is a reusable task instruction set for your AI coding agent (for example, an editor “slash command”, or an external prompt file that links to these QFAI prompt bodies).
|
|
46
|
+
The agent reads QFAI assets under `.qfai/assistant/` and produces or updates SDD/ATDD/TDD artifacts and code.
|
|
47
|
+
|
|
48
|
+
### Where the prompts live
|
|
49
|
+
|
|
50
|
+
- QFAI standard prompt bodies: `.qfai/assistant/prompts/**` (may be overwritten when you re-run `qfai init`).
|
|
51
|
+
- Your local overrides: `.qfai/assistant/prompts.local/**` (never overwritten by QFAI; prefer this for customizations).
|
|
52
|
+
- Rule: if the same relative path exists in both, treat `prompts.local/` as the higher-priority source.
|
|
53
|
+
|
|
54
|
+
### Minimal custom prompt set
|
|
55
|
+
|
|
56
|
+
QFAI includes a small set of custom prompts (stored under `.qfai/assistant/prompts/`) designed to keep the workflow opinionated and repeatable.
|
|
57
|
+
|
|
58
|
+
- **qfai-configure**: Analyze the repository (language, frameworks, test layout, directory structure) and update `qfai.config.yaml` with a minimal diff (especially `testFileGlobs`). Run this once right after `npx qfai init`, and re-run it when the repository structure changes. Output: updated YAML + validation checklist.
|
|
59
|
+
- **qfai-discuss**: Turn an idea into clear requirements by discussing scope, constraints, risks, and open questions.
|
|
60
|
+
- **qfai-require**: Produce `.qfai/require/require.md` from your idea or discussion output.
|
|
61
|
+
- **qfai-spec**: Produce `.qfai/specs/*` and `.qfai/contracts/*` from the requirements, including traceability scaffolding.
|
|
62
|
+
- **qfai-scenario-test**: Implement acceptance tests (ATDD) driven by specs/scenarios.
|
|
63
|
+
- **qfai-unit-test**: Implement unit tests (TDD) driven by specs/scenarios.
|
|
64
|
+
- **qfai-implement**: Implement the feature; iterate test→fix until all quality gates are green.
|
|
65
|
+
- **qfai-verify**: Run/interpret the local quality gates and produce a PR-ready summary.
|
|
66
|
+
|
|
67
|
+
### Workflow sequence (example)
|
|
68
|
+
|
|
69
|
+
This sequence shows which prompt to run, in what order, and what artifacts to expect.
|
|
70
|
+
|
|
71
|
+
```mermaid
|
|
72
|
+
sequenceDiagram
|
|
73
|
+
participant U as User
|
|
74
|
+
participant AG as AI Agent
|
|
75
|
+
participant Q as QFAI Kit (.qfai)
|
|
76
|
+
participant R as Repo (codebase)
|
|
77
|
+
|
|
78
|
+
U->>R: Create a repo (or open an existing one)
|
|
79
|
+
U->>R: Run npx qfai init
|
|
80
|
+
R-->>U: .qfai kit installed (prompts, instructions, agents)
|
|
81
|
+
|
|
82
|
+
U->>AG: Run /qfai-configure
|
|
83
|
+
AG->>Q: Read .qfai/assistant/prompts/qfai-configure.md
|
|
84
|
+
AG->>R: Update qfai.config.yaml (testFileGlobs, etc.)
|
|
85
|
+
AG-->>U: Config tuned to this repo
|
|
86
|
+
|
|
87
|
+
opt If you only have an idea
|
|
88
|
+
U->>AG: Run /qfai-discuss
|
|
89
|
+
AG-->>U: Clarified requirements (notes)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
U->>AG: Run /qfai-require
|
|
93
|
+
AG->>Q: Read .qfai/assistant/prompts/qfai-require.md
|
|
94
|
+
AG->>R: Create/Update requirements docs
|
|
95
|
+
AG-->>U: Requirements ready
|
|
96
|
+
|
|
97
|
+
U->>AG: Run /qfai-spec
|
|
98
|
+
AG->>Q: Read .qfai/assistant/prompts/qfai-spec.md
|
|
99
|
+
AG->>R: Create specs + contracts + scenario.feature
|
|
100
|
+
AG-->>U: SDD artifacts ready
|
|
101
|
+
|
|
102
|
+
U->>AG: Run /qfai-scenario-test
|
|
103
|
+
AG->>Q: Read .qfai/assistant/prompts/qfai-scenario-test.md
|
|
104
|
+
AG->>R: Implement acceptance tests
|
|
105
|
+
AG-->>U: Scenario tests ready
|
|
106
|
+
|
|
107
|
+
U->>AG: Run /qfai-unit-test
|
|
108
|
+
AG->>Q: Read .qfai/assistant/prompts/qfai-unit-test.md
|
|
109
|
+
AG->>R: Implement unit tests
|
|
110
|
+
AG-->>U: Unit tests ready
|
|
111
|
+
|
|
112
|
+
U->>AG: Run /qfai-implement
|
|
113
|
+
AG->>Q: Read .qfai/assistant/prompts/qfai-implement.md
|
|
114
|
+
loop Implement and fix until green
|
|
115
|
+
AG->>R: Implement code changes
|
|
116
|
+
AG->>R: Run project tests locally
|
|
117
|
+
end
|
|
118
|
+
AG-->>U: Working implementation (quality gates passing)
|
|
119
|
+
|
|
120
|
+
U->>R: Run npx qfai validate
|
|
121
|
+
U->>R: Run npx qfai report
|
|
122
|
+
R-->>U: Traceability checks and report artifacts
|
|
123
|
+
```
|
|
63
124
|
|
|
64
|
-
|
|
125
|
+
Operational notes.
|
|
65
126
|
|
|
66
|
-
|
|
127
|
+
- Each custom prompt must output in the user’s language (absolute requirement).
|
|
128
|
+
- Except `qfai-discuss`, each prompt must analyze the project context (architecture, tech stack, test framework, repo structure) before generating artifacts or code.
|
|
129
|
+
- Prompts should delegate work to multiple role-based sub-agents (Planner, Architect, Contract Designer, QA, Code Reviewer, etc.) to emulate a real delivery flow.
|
|
67
130
|
|
|
68
|
-
|
|
69
|
-
`report` は `.qfai/report/validate.json` を既定入力とし、`--in` で上書きできます(優先順位: CLI > config)。`--run-validate` を指定すると validate を実行してから report を生成します。出力先は `--out` で変更できます(`--format json` の場合は `.qfai/report/report.json`)。`--base-url <url>` を指定すると、report.md 内の相対パスをリンク化します(例: `npx qfai report --base-url https://example.com/repo`)。
|
|
70
|
-
`doctor` は validate/report の前段で設定/探索/パス/glob/validate.json を診断します。`--format text|json`、`--out` をサポートし、診断のみ(修復はしません)。`--fail-on warning|error` を指定すると該当 severity 以上で exit 1(未指定は常に exit 0)になります。
|
|
131
|
+
## Configuration
|
|
71
132
|
|
|
72
|
-
|
|
133
|
+
Configuration is stored at the repository root as `qfai.config.yaml`; you can change paths, traceability policies, and CI gate thresholds.
|
|
73
134
|
|
|
74
|
-
|
|
135
|
+
Example: override paths and traceability globs.
|
|
75
136
|
|
|
76
|
-
|
|
77
|
-
|
|
137
|
+
```yaml
|
|
138
|
+
paths:
|
|
139
|
+
qfaiDir: .qfai
|
|
140
|
+
reportDir: .qfai/report
|
|
141
|
+
requireDir: .qfai/require
|
|
142
|
+
specsDir: .qfai/specs
|
|
143
|
+
contractsDir: .qfai/contracts
|
|
144
|
+
validation:
|
|
145
|
+
failOn: error # error | warning | never
|
|
146
|
+
strict: false # if true, warnings also fail (equivalent to failOn=warning)
|
|
147
|
+
traceability:
|
|
148
|
+
testFileGlobs:
|
|
149
|
+
- "src/**/*.test.ts"
|
|
150
|
+
- "tests/**/*.spec.ts"
|
|
151
|
+
testFileExcludeGlobs:
|
|
152
|
+
- "**/fixtures/**"
|
|
153
|
+
scMustHaveTest: true
|
|
154
|
+
scNoTestSeverity: warning # error | warning
|
|
155
|
+
```
|
|
78
156
|
|
|
79
|
-
|
|
157
|
+
Notes.
|
|
80
158
|
|
|
81
|
-
`report.json
|
|
159
|
+
- `validate.json`, `report.json`, and `doctor.json` are internal exports and are not a stable external contract; prefer `report.md` for integrations that must survive tool upgrades.
|
|
160
|
+
- Scenario files are expected to use the Gherkin extension `*.feature` (not `*.md`).
|
|
82
161
|
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
"tool": "qfai",
|
|
86
|
-
"summary": {
|
|
87
|
-
"specs": 1,
|
|
88
|
-
"scenarios": 1,
|
|
89
|
-
"contracts": { "api": 0, "ui": 1, "db": 0, "thema": 0 },
|
|
90
|
-
"counts": { "info": 0, "warning": 0, "error": 0 }
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
```
|
|
162
|
+
## Specifications and contracts (SDD)
|
|
94
163
|
|
|
95
|
-
|
|
164
|
+
QFAI uses a small, opinionated set of artifacts to reduce ambiguity and prevent agents from “inventing” behavior.
|
|
96
165
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
166
|
+
- Requirements: what you want to achieve, constraints, and explicit non-goals.
|
|
167
|
+
- Specs: structured expected behaviors, inputs/outputs, edge cases, and invariants.
|
|
168
|
+
- Contracts:
|
|
169
|
+
- UI contracts: YAML (`.yaml` / `.yml`)
|
|
170
|
+
- API contracts: YAML (`.yaml` / `.yml`)
|
|
171
|
+
- DB contracts: SQL (`.sql`)
|
|
172
|
+
- Scenarios (ATDD): Gherkin `.feature` files
|
|
102
173
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"tool": "qfai",
|
|
108
|
-
"checks": [
|
|
109
|
-
{
|
|
110
|
-
"id": "config.search",
|
|
111
|
-
"severity": "ok",
|
|
112
|
-
"message": "qfai.config.yaml found"
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
```
|
|
174
|
+
Traceability is validated across these artifacts, so code changes remain grounded in the specs and the tests prove compliance.
|
|
117
175
|
|
|
118
|
-
|
|
176
|
+
## Continuous integration (GitHub Actions)
|
|
119
177
|
|
|
120
|
-
|
|
121
|
-
- `specs/` `contracts/` は初回にサンプルが生成されますが、再実行(force の有無に関わらず)で上書きしません
|
|
122
|
-
- それ以外を再生成したい場合は、対象を手動で削除してから `qfai init` を実行してください(運用中成果物の破壊を避けるため)
|
|
178
|
+
(GitHub Actions)
|
|
123
179
|
|
|
124
|
-
|
|
180
|
+
`npx qfai init` generates `.github/workflows/qfai.yml` which runs `npx qfai validate --fail-on error` on pull requests and on pushes to `main`, and uploads `.qfai/report/validate.json` as an artifact.
|
|
125
181
|
|
|
126
|
-
|
|
127
|
-
命名規約は GitHub の[命名規約ドキュメント](https://github.com/aganesy/QFAI/blob/main/docs/rules/naming.md)を参照してください。
|
|
182
|
+
What works out-of-the-box.
|
|
128
183
|
|
|
129
|
-
|
|
184
|
+
- The generated workflow is npm-oriented (`npm ci`); if your repository uses pnpm/yarn/bun, replace the install/cache steps accordingly.
|
|
185
|
+
- The default validate gate fails only on `error`; use `--fail-on warning` or `--strict` if you want a stricter gate.
|
|
130
186
|
|
|
131
|
-
|
|
132
|
-
Scenario では `# QFAI-CONTRACT-REF:` のコメント行で契約参照を宣言します(`none` 可)。
|
|
133
|
-
契約ファイルは `QFAI-CONTRACT-ID: <ID>` を **1ファイル1ID** で宣言します。
|
|
134
|
-
契約IDは UI/API/DB/THEMA(THEMA は 3 桁)です。UI 契約は `themaRef` / `themeOverrides` / `assets` を追加できます。
|
|
135
|
-
`assets.pack` は `ui/` 配下の相対パス、`assets.use` は `assets.yaml` の `items[].id` を参照します。
|
|
136
|
-
`validate.json` / `report` の file path は root 相対で出力します(absolute は出力しません)。
|
|
187
|
+
Typical customizations.
|
|
137
188
|
|
|
138
|
-
|
|
189
|
+
- Add a second job to generate `report.md` from the uploaded `validate.json`.
|
|
190
|
+
- Add a `doctor` step before validate if you want to fail fast on path/glob/config issues.
|
|
191
|
+
- Tune traceability globs in `qfai.config.yaml` to match your test layout.
|
|
139
192
|
|
|
140
|
-
|
|
141
|
-
- monorepo ではパッケージ単位に `qfai.config.yaml` を置くか、`--root` で明示します。
|
|
142
|
-
- `paths.outDir` はパッケージごとに分け、`report/` の衝突を避けてください。
|
|
193
|
+
## Generated structure
|
|
143
194
|
|
|
144
|
-
|
|
195
|
+
`npx qfai init` generates the following structure in your repository.
|
|
145
196
|
|
|
146
197
|
```text
|
|
147
|
-
|
|
148
|
-
|
|
198
|
+
.
|
|
199
|
+
├── .claude
|
|
200
|
+
│ └── commands
|
|
201
|
+
│ ├── qfai-configure.md
|
|
202
|
+
│ ├── qfai-discuss.md
|
|
203
|
+
│ ├── qfai-implement.md
|
|
204
|
+
│ ├── qfai-require.md
|
|
205
|
+
│ ├── qfai-scenario-test.md
|
|
206
|
+
│ ├── qfai-spec.md
|
|
207
|
+
│ ├── qfai-unit-test.md
|
|
208
|
+
│ └── qfai-verify.md
|
|
209
|
+
├── .codex
|
|
210
|
+
│ └── skills
|
|
211
|
+
│ ├── qfai-configure
|
|
212
|
+
│ │ └── SKILL.md
|
|
213
|
+
│ ├── qfai-discuss
|
|
214
|
+
│ │ └── SKILL.md
|
|
215
|
+
│ ├── qfai-implement
|
|
216
|
+
│ │ └── SKILL.md
|
|
217
|
+
│ ├── qfai-require
|
|
218
|
+
│ │ └── SKILL.md
|
|
219
|
+
│ ├── qfai-scenario-test
|
|
220
|
+
│ │ └── SKILL.md
|
|
221
|
+
│ ├── qfai-spec
|
|
222
|
+
│ │ └── SKILL.md
|
|
223
|
+
│ ├── qfai-unit-test
|
|
224
|
+
│ │ └── SKILL.md
|
|
225
|
+
│ └── qfai-verify
|
|
226
|
+
│ └── SKILL.md
|
|
227
|
+
├── .github
|
|
228
|
+
│ ├── prompts
|
|
229
|
+
│ │ ├── qfai-configure.prompt.md
|
|
230
|
+
│ │ ├── qfai-discuss.prompt.md
|
|
231
|
+
│ │ ├── qfai-implement.prompt.md
|
|
232
|
+
│ │ ├── qfai-require.prompt.md
|
|
233
|
+
│ │ ├── qfai-scenario-test.prompt.md
|
|
234
|
+
│ │ ├── qfai-spec.prompt.md
|
|
235
|
+
│ │ ├── qfai-unit-test.prompt.md
|
|
236
|
+
│ │ └── qfai-verify.prompt.md
|
|
237
|
+
│ ├── workflows
|
|
238
|
+
│ │ └── qfai.yml
|
|
239
|
+
│ └── copilot-instructions.md
|
|
240
|
+
├── .qfai
|
|
241
|
+
│ ├── assistant
|
|
242
|
+
│ │ ├── agents
|
|
243
|
+
│ │ │ ├── README.md
|
|
244
|
+
│ │ │ ├── architect.md
|
|
245
|
+
│ │ │ ├── backend-engineer.md
|
|
246
|
+
│ │ │ ├── code-reviewer.md
|
|
247
|
+
│ │ │ ├── contract-designer.md
|
|
248
|
+
│ │ │ ├── devops-ci-engineer.md
|
|
249
|
+
│ │ │ ├── facilitator.md
|
|
250
|
+
│ │ │ ├── frontend-engineer.md
|
|
251
|
+
│ │ │ ├── interviewer.md
|
|
252
|
+
│ │ │ ├── planner.md
|
|
253
|
+
│ │ │ ├── qa-engineer.md
|
|
254
|
+
│ │ │ ├── requirements-analyst.md
|
|
255
|
+
│ │ │ └── test-engineer.md
|
|
256
|
+
│ │ ├── instructions
|
|
257
|
+
│ │ │ ├── README.md
|
|
258
|
+
│ │ │ ├── agent-selection.md
|
|
259
|
+
│ │ │ ├── communication.md
|
|
260
|
+
│ │ │ ├── constitution.md
|
|
261
|
+
│ │ │ ├── quality.md
|
|
262
|
+
│ │ │ ├── thinking.md
|
|
263
|
+
│ │ │ └── workflow.md
|
|
264
|
+
│ │ ├── prompts
|
|
265
|
+
│ │ │ ├── README.md
|
|
266
|
+
│ │ │ ├── qfai-configure.md
|
|
267
|
+
│ │ │ ├── qfai-discuss.md
|
|
268
|
+
│ │ │ ├── qfai-implement.md
|
|
269
|
+
│ │ │ ├── qfai-require.md
|
|
270
|
+
│ │ │ ├── qfai-scenario-test.md
|
|
271
|
+
│ │ │ ├── qfai-spec.md
|
|
272
|
+
│ │ │ ├── qfai-unit-test.md
|
|
273
|
+
│ │ │ └── qfai-verify.md
|
|
274
|
+
│ │ ├── prompts.local
|
|
275
|
+
│ │ │ └── README.md
|
|
276
|
+
│ │ ├── steering
|
|
277
|
+
│ │ │ ├── README.md
|
|
278
|
+
│ │ │ ├── product.md
|
|
279
|
+
│ │ │ ├── structure.md
|
|
280
|
+
│ │ │ └── tech.md
|
|
281
|
+
│ │ └── README.md
|
|
282
|
+
│ ├── contracts
|
|
283
|
+
│ │ ├── api
|
|
284
|
+
│ │ │ └── README.md
|
|
285
|
+
│ │ ├── db
|
|
286
|
+
│ │ │ └── README.md
|
|
287
|
+
│ │ ├── ui
|
|
288
|
+
│ │ │ └── README.md
|
|
289
|
+
│ │ └── README.md
|
|
290
|
+
│ ├── report
|
|
291
|
+
│ │ └── README.md
|
|
292
|
+
│ ├── require
|
|
293
|
+
│ │ ├── README.md
|
|
294
|
+
│ │ └── require.md
|
|
295
|
+
│ ├── specs
|
|
296
|
+
│ │ └── README.md
|
|
297
|
+
│ └── README.md
|
|
298
|
+
└── qfai.config.yaml
|
|
149
299
|
```
|
|
150
300
|
|
|
151
|
-
##
|
|
152
|
-
|
|
153
|
-
- 「CIで検出する」= `validate` が issue を出す(info/warning/error を含む)
|
|
154
|
-
- 「Hard Gate」= `--fail-on error` で CI を停止する領域
|
|
155
|
-
- Spec→下流参照禁止は Hard Gate にしない(検出する場合でも warning に留める)
|
|
156
|
-
|
|
157
|
-
SC→Test の参照はテストコード内の `QFAI:SC-xxxx` アノテーションで宣言します。
|
|
158
|
-
SC→Test の対象ファイルは `validation.traceability.testFileGlobs` で指定します。
|
|
159
|
-
除外は `validation.traceability.testFileExcludeGlobs` で指定できます。
|
|
160
|
-
SC→Test 検証は `validation.traceability.scMustHaveTest` と
|
|
161
|
-
`validation.traceability.scNoTestSeverity` で制御できます。
|
|
162
|
-
|
|
163
|
-
- `validation.traceability.testFileGlobs`: SC→Test 判定に使用するテストファイル glob(配列)
|
|
164
|
-
- `validation.traceability.testFileExcludeGlobs`: 追加の除外 glob(配列、任意)
|
|
165
|
-
- `validation.traceability.scMustHaveTest`: SC→Test 検証の有効/無効を制御(`true` で有効、`false` で無効)
|
|
166
|
-
- `validation.traceability.scNoTestSeverity`: SC 未参照時の重要度を指定(`error` / `warning`)
|
|
167
|
-
|
|
168
|
-
## GitHub Actions テンプレート
|
|
169
|
-
|
|
170
|
-
`npx qfai init` で `.github/workflows/qfai.yml` を生成します。テンプレートは `validate` ジョブで `.qfai/report/validate.json` を生成し、`qfai-validation` として artifact をアップロードします。`report` はテンプレートには含まれないため、必要なら別ジョブまたはローカルで `qfai report` を実行してください。
|
|
301
|
+
## Agent integrations (Copilot / Claude Code / Codex)
|
|
171
302
|
|
|
172
|
-
|
|
173
|
-
各 Actions のバージョンは運用方針に合わせて指定してください。
|
|
303
|
+
`npx qfai init` also installs lightweight integration stubs so your AI coding agent can invoke QFAI custom prompts directly.
|
|
174
304
|
|
|
175
|
-
|
|
305
|
+
- **GitHub Copilot prompt files**: `.github/prompts/*.prompt.md` (invoke from Copilot Chat as `/qfai-...`).
|
|
306
|
+
- **GitHub Copilot repository instructions**: `.github/copilot-instructions.md` (baseline behavior guidance for Copilot in this repo).
|
|
307
|
+
- **Claude Code slash commands**: `.claude/commands/*.md` (invoke as `/qfai-...`).
|
|
308
|
+
- **OpenAI Codex skills**: `.codex/skills/*/SKILL.md` (invoke as Codex skills; each skill points to the canonical QFAI prompt).
|
|
176
309
|
|
|
177
|
-
|
|
178
|
-
jobs:
|
|
179
|
-
report:
|
|
180
|
-
needs: validate
|
|
181
|
-
runs-on: ubuntu-latest
|
|
182
|
-
steps:
|
|
183
|
-
- uses: actions/checkout@v4
|
|
184
|
-
- uses: actions/setup-node@v4
|
|
185
|
-
with:
|
|
186
|
-
node-version: lts/*
|
|
187
|
-
cache: npm
|
|
188
|
-
- run: npm ci
|
|
189
|
-
- uses: actions/download-artifact@v4
|
|
190
|
-
with:
|
|
191
|
-
name: qfai-validation
|
|
192
|
-
path: .qfai/report
|
|
193
|
-
- run: npx qfai report --out .qfai/report/report.md
|
|
194
|
-
- uses: actions/upload-artifact@v4
|
|
195
|
-
with:
|
|
196
|
-
name: qfai-report
|
|
197
|
-
path: .qfai/report/report.md
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
validate.json のスキーマと例は GitHub の
|
|
201
|
-
[schema](https://github.com/aganesy/QFAI/tree/main/docs/schema) /
|
|
202
|
-
[examples](https://github.com/aganesy/QFAI/tree/main/docs/examples) を参照してください。
|
|
203
|
-
|
|
204
|
-
## 生成される構成(例)
|
|
310
|
+
Each of these files is intentionally thin and forwards to the canonical source of truth under `.qfai/assistant/prompts/`.
|
|
205
311
|
|
|
206
|
-
|
|
207
|
-
qfai.config.yaml
|
|
208
|
-
.qfai/
|
|
209
|
-
README.md
|
|
210
|
-
report/
|
|
211
|
-
README.md
|
|
212
|
-
require/
|
|
213
|
-
README.md
|
|
214
|
-
require.md
|
|
215
|
-
specs/
|
|
216
|
-
README.md
|
|
217
|
-
spec-0001/
|
|
218
|
-
spec.md
|
|
219
|
-
delta.md
|
|
220
|
-
scenario.feature
|
|
221
|
-
contracts/
|
|
222
|
-
README.md
|
|
223
|
-
api/
|
|
224
|
-
api-0001-sample.yaml
|
|
225
|
-
ui/
|
|
226
|
-
ui-0001-sample.yaml
|
|
227
|
-
thema-001-facebook-like.yml
|
|
228
|
-
assets/
|
|
229
|
-
ui-0001-sample/
|
|
230
|
-
assets.yaml
|
|
231
|
-
snapshots/login__desktop__light__default.png
|
|
232
|
-
thema-001-facebook-like/
|
|
233
|
-
assets.yaml
|
|
234
|
-
palette.png
|
|
235
|
-
db/
|
|
236
|
-
db-0001-sample.sql
|
|
237
|
-
assistant/
|
|
238
|
-
README.md
|
|
239
|
-
instructions/
|
|
240
|
-
README.md
|
|
241
|
-
constitution.md
|
|
242
|
-
workflow.md
|
|
243
|
-
steering/
|
|
244
|
-
README.md
|
|
245
|
-
product.md
|
|
246
|
-
tech.md
|
|
247
|
-
structure.md
|
|
248
|
-
prompts/
|
|
249
|
-
README.md
|
|
250
|
-
qfai-discuss.md
|
|
251
|
-
qfai-require.md
|
|
252
|
-
qfai-spec.md
|
|
253
|
-
qfai-scenario-test.md
|
|
254
|
-
qfai-unit-test.md
|
|
255
|
-
qfai-implement.md
|
|
256
|
-
qfai-verify.md
|
|
257
|
-
qfai-pr.md
|
|
258
|
-
prompts.local/
|
|
259
|
-
README.md
|
|
260
|
-
agents/
|
|
261
|
-
README.md
|
|
262
|
-
facilitator.md
|
|
263
|
-
interviewer.md
|
|
264
|
-
requirements-analyst.md
|
|
265
|
-
planner.md
|
|
266
|
-
architect.md
|
|
267
|
-
contract-designer.md
|
|
268
|
-
qa-engineer.md
|
|
269
|
-
test-engineer.md
|
|
270
|
-
frontend-engineer.md
|
|
271
|
-
backend-engineer.md
|
|
272
|
-
devops-ci-engineer.md
|
|
273
|
-
code-reviewer.md
|
|
274
|
-
tests/
|
|
275
|
-
qfai-traceability.sample.test.ts
|
|
276
|
-
.github/
|
|
277
|
-
workflows/
|
|
278
|
-
qfai.yml
|
|
279
|
-
```
|
|
312
|
+
## Contributing (for QFAI maintainers)
|
|
280
313
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
```sh
|
|
284
|
-
pnpm install
|
|
285
|
-
pnpm build
|
|
286
|
-
pnpm format:check
|
|
287
|
-
pnpm lint
|
|
288
|
-
pnpm check-types
|
|
289
|
-
pnpm test:assets
|
|
290
|
-
```
|
|
314
|
+
This repository is a monorepo, and the distributable package is under `packages/qfai`; if you change documentation, keep the repository root README and the package README aligned (the CI enforces this).
|
|
291
315
|
|
|
292
|
-
##
|
|
316
|
+
## License
|
|
293
317
|
|
|
294
|
-
|
|
318
|
+
MIT
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# .qfai (QFAI Workspace)
|
|
2
2
|
|
|
3
|
-
Generated by: `qfai init`
|
|
4
|
-
|
|
5
|
-
Updated: 2026-01-12
|
|
3
|
+
Generated by: `qfai init`
|
|
4
|
+
Template version: 1.0.6
|
|
6
5
|
|
|
7
6
|
This directory is the workspace for **QFAI (Quality‑First AI)**.
|
|
8
7
|
QFAI standardizes engineering work around a fixed workflow:
|
|
9
8
|
|
|
9
|
+
Note: You may edit files under `.qfai/` to fit your project. QFAI prompts treat this workspace as project-local SSOT for guidance and artifacts.
|
|
10
|
+
|
|
10
11
|
**SDD → ATDD → TDD → Implementation → Verification**
|
|
11
12
|
|
|
12
13
|
## Directory Overview
|
|
@@ -32,3 +32,5 @@ Each role card includes YAML frontmatter:
|
|
|
32
32
|
## Response contract
|
|
33
33
|
|
|
34
34
|
All subagents must use the "Findings / Recommendations / Proposed edits / Open Questions / Confidence" structure.
|
|
35
|
+
|
|
36
|
+
Note: These are **role cards** (definitions). Actual delegation/execution depends on your AI product (Copilot, Claude Code, etc.). If subagents are not supported, the orchestrator prompt must emulate role-by-role reasoning in a single run.
|
|
@@ -57,7 +57,7 @@ You are the **Contract Designer** in a QFAI-driven workflow.
|
|
|
57
57
|
|
|
58
58
|
## Expected Outputs
|
|
59
59
|
|
|
60
|
-
- Contract file list +
|
|
60
|
+
- Contract file list + drafts (**UI/API: YAML**, **DB: SQL**).
|
|
61
61
|
- Rationale for each field.
|
|
62
62
|
- Example payloads where helpful.
|
|
63
63
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# instructions/
|
|
2
2
|
|
|
3
|
-
High-level governance for AI behavior.
|
|
3
|
+
High-level governance for AI behavior in QFAI.
|
|
4
4
|
|
|
5
5
|
- `constitution.md` : non-negotiable rules (quality, traceability, evidence)
|
|
6
6
|
- `workflow.md` : the default QFAI workflow (SDD→ATDD→TDD→Implement→Verify)
|
|
7
|
+
- `thinking.md` : ambiguity elimination + evidence-first reasoning
|
|
8
|
+
- `communication.md` : reporting style + status format
|
|
9
|
+
- `quality.md` : quality gates + testing expectations
|
|
10
|
+
- `agent-selection.md` : how to delegate to roles (or emulate if unsupported)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: agent-selection
|
|
3
|
+
category: project
|
|
4
|
+
update_frequency: occasional
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Selection (Delegation playbook)
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
Delegate work to specialized roles to reduce blind spots and improve quality.
|
|
12
|
+
|
|
13
|
+
## Default delegation map
|
|
14
|
+
|
|
15
|
+
- **Requirements Analyst**: clarify intent, scope, acceptance criteria, open questions
|
|
16
|
+
- **Planner**: plan phases, risks, gating, rollback strategy
|
|
17
|
+
- **Architect**: design, boundaries, compatibility considerations
|
|
18
|
+
- **Contract Designer**: contracts (UI/API: YAML, DB: SQL), IDs, indexing implications
|
|
19
|
+
- **QA Engineer**: risk-based checks, regression scope, quality gate review
|
|
20
|
+
- **Test Engineer**: scenario.feature and test scaffolding strategy
|
|
21
|
+
- **Front-end / Back-end Engineer**: implementation within repo conventions
|
|
22
|
+
- **DevOps/CI Engineer**: verify-pack/CI impacts
|
|
23
|
+
- **Code Reviewer**: style, maintainability, correctness
|
|
24
|
+
|
|
25
|
+
## If subagents are not supported
|
|
26
|
+
|
|
27
|
+
Emulate the delegation by doing role-by-role analysis in order:
|
|
28
|
+
Requirements → Plan → Design → Contracts → Tests → Implementation → Review → QA.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: communication
|
|
3
|
+
category: universal
|
|
4
|
+
update_frequency: occasional
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Communication (Output and reporting contract)
|
|
8
|
+
|
|
9
|
+
## Absolute rule — Output language
|
|
10
|
+
|
|
11
|
+
All user-facing output must be in **the user's language**.
|
|
12
|
+
If multiple languages appear, choose the user's dominant language.
|
|
13
|
+
|
|
14
|
+
## Reporting format (default)
|
|
15
|
+
|
|
16
|
+
Use concise, structured bullet points:
|
|
17
|
+
|
|
18
|
+
- **Summary**: what changed / decided
|
|
19
|
+
- **Evidence**: key file paths / commands / logs referenced
|
|
20
|
+
- **Impact**: user-visible changes, risks
|
|
21
|
+
- **Verification**: what you ran and expected result
|
|
22
|
+
- **Open Questions**: unresolved items (if any)
|
|
23
|
+
|
|
24
|
+
## Error handling
|
|
25
|
+
|
|
26
|
+
- Do not hide errors. Explain impact, scope, and recovery steps.
|
|
27
|
+
- Avoid dumping excessive logs; show the minimum relevant excerpt.
|