qfai 1.0.6 → 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.
Files changed (36) hide show
  1. package/README.md +274 -253
  2. package/assets/init/.qfai/assistant/prompts/README.md +1 -1
  3. package/assets/init/.qfai/assistant/prompts/qfai-configure.md +174 -0
  4. package/assets/init/root/.claude/commands/qfai-configure.md +14 -0
  5. package/assets/init/root/.claude/commands/qfai-discuss.md +14 -0
  6. package/assets/init/root/.claude/commands/qfai-implement.md +14 -0
  7. package/assets/init/root/.claude/commands/qfai-require.md +14 -0
  8. package/assets/init/root/.claude/commands/qfai-scenario-test.md +14 -0
  9. package/assets/init/root/.claude/commands/qfai-spec.md +14 -0
  10. package/assets/init/root/.claude/commands/qfai-unit-test.md +14 -0
  11. package/assets/init/root/.claude/commands/qfai-verify.md +14 -0
  12. package/assets/init/root/.codex/README.md +16 -0
  13. package/assets/init/root/.codex/skills/qfai-configure/SKILL.md +18 -0
  14. package/assets/init/root/.codex/skills/qfai-discuss/SKILL.md +18 -0
  15. package/assets/init/root/.codex/skills/qfai-implement/SKILL.md +18 -0
  16. package/assets/init/root/.codex/skills/qfai-require/SKILL.md +18 -0
  17. package/assets/init/root/.codex/skills/qfai-scenario-test/SKILL.md +18 -0
  18. package/assets/init/root/.codex/skills/qfai-spec/SKILL.md +18 -0
  19. package/assets/init/root/.codex/skills/qfai-unit-test/SKILL.md +18 -0
  20. package/assets/init/root/.codex/skills/qfai-verify/SKILL.md +18 -0
  21. package/assets/init/root/.github/copilot-instructions.md +14 -0
  22. package/assets/init/root/.github/prompts/qfai-configure.prompt.md +17 -0
  23. package/assets/init/root/.github/prompts/qfai-discuss.prompt.md +17 -0
  24. package/assets/init/root/.github/prompts/qfai-implement.prompt.md +17 -0
  25. package/assets/init/root/.github/prompts/qfai-require.prompt.md +17 -0
  26. package/assets/init/root/.github/prompts/qfai-scenario-test.prompt.md +17 -0
  27. package/assets/init/root/.github/prompts/qfai-spec.prompt.md +17 -0
  28. package/assets/init/root/.github/prompts/qfai-unit-test.prompt.md +17 -0
  29. package/assets/init/root/.github/prompts/qfai-verify.prompt.md +17 -0
  30. package/dist/cli/index.cjs +10 -4
  31. package/dist/cli/index.cjs.map +1 -1
  32. package/dist/cli/index.mjs +10 -4
  33. package/dist/cli/index.mjs.map +1 -1
  34. package/dist/index.cjs +2 -2
  35. package/dist/index.mjs +2 -2
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -1,297 +1,318 @@
1
- # QFAI Toolkit
1
+ # QFAI (Quality-First AI)
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/qfai.svg?style=flat)](https://www.npmjs.com/package/qfai)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
- [![Node.js](https://img.shields.io/badge/Node.js->=18-brightgreen.svg)](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
- 品質重視型AI駆動運用モデル(SDD × ATDD × TDD)を単一パッケージで提供するツールキットです。
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
- - [Quick Start](#quick-start最短成功)
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
- ```sh
26
- npm install -D qfai
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
- - `qfai`: CLI + コア + テンプレートを同梱
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` によるテンプレート生成(specs/contracts に加え、`.qfai/require/README.md`、`.qfai/report/README.md`、`.qfai/assistant/**` を含む)
59
- - `npx qfai validate` による `.qfai/` 内ドキュメントの整合性・トレーサビリティ検査
60
- - `npx qfai validate` による SC→Test 参照の検証(`validation.traceability.testFileGlobs` に一致するテストファイルから `QFAI:SC-xxxx` を抽出)
61
- - `npx qfai doctor` による設定/探索/パス/glob/validate.json の事前診断
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
- 補足: v1.x は日本語テンプレ中心で提供します。将来は英語を正本、日本語を別ドキュメントに切り替える方針です。
125
+ Operational notes.
65
126
 
66
- ## 使い方(CLI)
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
- `validate` は `--fail-on` / `--strict` によって CI ゲート化できます。`validate` は常に `.qfai/report/validate.json`(`output.validateJsonPath`)へ JSON を出力します。`--format` は画面表示(text/github)のみを制御します。`--format github` はアノテーションの上限と重複排除を行い、先頭にサマリを出します(全量は `validate.json` か `--format text` を参照)。
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
- ### Prompts Overlay(v0.7 以降の方針)
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
- QFAI が提供するプロンプト資産は次の 2 つに分離します。
135
+ Example: override paths and traceability globs.
75
136
 
76
- - `.qfai/assistant/prompts/**`: QFAI 標準資産(更新や `qfai init` 再実行で上書きされ得る。利用者編集は非推奨・非サポート)
77
- - `.qfai/assistant/prompts.local/**`: 利用者カスタム資産(QFAI はここを上書きしない)
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
- 同じ相対パスのファイルがある場合は `.qfai/assistant/prompts.local` を優先して参照する運用とします。
157
+ Notes.
80
158
 
81
- `report.json` / `doctor.json` は内部表現で互換非保証です。外部連携は `report.md` など Markdown 出力を推奨します。破壊的変更は原則 SemVer で管理しますが、プロジェクト方針により例外的に minor/patch で破壊的変更を行う場合があります(CHANGELOG に明記)。JSON schema を固定する約束はしません。短い例:
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
- ```json
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
- doctor(text)の例:
164
+ QFAI uses a small, opinionated set of artifacts to reduce ambiguity and prevent agents from “inventing” behavior.
96
165
 
97
- ```text
98
- qfai doctor: root=. config=qfai.config.yaml (found)
99
- [ok] config.search: qfai.config.yaml found
100
- summary: ok=10 info=1 warning=2 error=0
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
- doctor JSON 例:
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
- `init --yes` は予約フラグです(現行の init は非対話のため挙動差はありません)。
176
+ ## Continuous integration (GitHub Actions)
119
177
 
120
- - `--force` は `.qfai/assistant/prompts/**` のみ上書きします(それ以外は既存があればスキップします)
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
- 設定はリポジトリ直下の `qfai.config.yaml` で行います。
127
- 命名規約は GitHub の[命名規約ドキュメント](https://github.com/aganesy/QFAI/blob/main/docs/rules/naming.md)を参照してください。
182
+ What works out-of-the-box.
128
183
 
129
- ## 契約(Contracts)
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
- Spec では `QFAI-CONTRACT-REF:` 行で参照する契約IDを宣言します(`none` 可)。Spec の先頭 H1 に `SPEC-xxxx` が必須です。
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
- UI/API は YAML、DB は SQL(`.sql`)を正式フォーマットとして扱います。
136
- `assets.pack` は `ui/` 配下の相対パス、`assets.use` は `assets.yaml` の `items[].id` を参照します。
137
- `validate.json` / `report` の file path は root 相対で出力します(absolute は出力しません)。
187
+ Typical customizations.
138
188
 
139
- ## Monorepo / サブディレクトリ
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.
140
192
 
141
- - `--root` 未指定時は cwd から親へ `qfai.config.yaml` を探索します(見つからない場合は defaultConfig + warning)。
142
- - monorepo ではパッケージ単位に `qfai.config.yaml` を置くか、`--root` で明示します。
143
- - `paths.outDir` はパッケージごとに分け、`report/` の衝突を避けてください。
193
+ ## Generated structure
144
194
 
145
- 例(pnpm workspace):
195
+ `npx qfai init` generates the following structure in your repository.
146
196
 
147
197
  ```text
148
- packages/<app-a>/qfai.config.yaml # paths.outDir: .qfai/report/<app-a>
149
- packages/<app-b>/qfai.config.yaml # paths.outDir: .qfai/report/<app-b>
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
150
299
  ```
151
300
 
152
- ## CI Hard Gate
153
-
154
- - 「CIで検出する」= `validate` が issue を出す(info/warning/error を含む)
155
- - 「Hard Gate」= `--fail-on error` で CI を停止する領域
156
- - Spec→下流参照禁止は Hard Gate にしない(検出する場合でも warning に留める)
157
-
158
- SC→Test の参照はテストコード内の `QFAI:SC-xxxx` アノテーションで宣言します。
159
- SC→Test の対象ファイルは `validation.traceability.testFileGlobs` で指定します。
160
- 除外は `validation.traceability.testFileExcludeGlobs` で指定できます。
161
- SC→Test 検証は `validation.traceability.scMustHaveTest` と
162
- `validation.traceability.scNoTestSeverity` で制御できます。
163
-
164
- - `validation.traceability.testFileGlobs`: SC→Test 判定に使用するテストファイル glob(配列)
165
- - `validation.traceability.testFileExcludeGlobs`: 追加の除外 glob(配列、任意)
166
- - `validation.traceability.scMustHaveTest`: SC→Test 検証の有効/無効を制御(`true` で有効、`false` で無効)
167
- - `validation.traceability.scNoTestSeverity`: SC 未参照時の重要度を指定(`error` / `warning`)
168
-
169
- ## GitHub Actions テンプレート
170
-
171
- `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)
172
302
 
173
- テンプレートは npm 前提です。pnpm を使う場合は `cache` install コマンドを置き換えてください。
174
- 各 Actions のバージョンは運用方針に合わせて指定してください。
303
+ `npx qfai init` also installs lightweight integration stubs so your AI coding agent can invoke QFAI custom prompts directly.
175
304
 
176
- 追加で `report` を回す場合の最小例:
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).
177
309
 
178
- ```yaml
179
- jobs:
180
- report:
181
- needs: validate
182
- runs-on: ubuntu-latest
183
- steps:
184
- - uses: actions/checkout@v4
185
- - uses: actions/setup-node@v4
186
- with:
187
- node-version: lts/*
188
- cache: npm
189
- - run: npm ci
190
- - uses: actions/download-artifact@v4
191
- with:
192
- name: qfai-validation
193
- path: .qfai/report
194
- - run: npx qfai report --out .qfai/report/report.md
195
- - uses: actions/upload-artifact@v4
196
- with:
197
- name: qfai-report
198
- path: .qfai/report/report.md
199
- ```
200
-
201
- validate.json のスキーマと例は GitHub の
202
- [schema](https://github.com/aganesy/QFAI/tree/main/docs/schema) /
203
- [examples](https://github.com/aganesy/QFAI/tree/main/docs/examples) を参照してください。
204
-
205
- ## 生成される構成(例)
310
+ Each of these files is intentionally thin and forwards to the canonical source of truth under `.qfai/assistant/prompts/`.
206
311
 
207
- ```
208
- qfai.config.yaml
209
- .qfai/
210
- README.md
211
- report/
212
- README.md
213
- require/
214
- README.md
215
- require.md
216
- specs/
217
- README.md
218
- spec-0001/
219
- spec.md
220
- delta.md
221
- scenario.feature
222
- contracts/
223
- README.md
224
- api/
225
- api-0001-sample.yaml
226
- ui/
227
- ui-0001-sample.yaml
228
- thema-001-facebook-like.yml
229
- assets/
230
- ui-0001-sample/
231
- assets.yaml
232
- snapshots/login__desktop__light__default.png
233
- thema-001-facebook-like/
234
- assets.yaml
235
- palette.png
236
- db/
237
- db-0001-sample.sql
238
- assistant/
239
- README.md
240
- instructions/
241
- README.md
242
- constitution.md
243
- workflow.md
244
- thinking.md
245
- communication.md
246
- quality.md
247
- agent-selection.md
248
- steering/
249
- README.md
250
- product.md
251
- tech.md
252
- structure.md
253
- prompts/
254
- README.md
255
- qfai-discuss.md
256
- qfai-require.md
257
- qfai-spec.md
258
- qfai-scenario-test.md
259
- qfai-unit-test.md
260
- qfai-implement.md
261
- qfai-verify.md
262
- qfai-pr.md
263
- prompts.local/
264
- README.md
265
- agents/
266
- README.md
267
- facilitator.md
268
- interviewer.md
269
- requirements-analyst.md
270
- planner.md
271
- architect.md
272
- contract-designer.md
273
- qa-engineer.md
274
- test-engineer.md
275
- frontend-engineer.md
276
- backend-engineer.md
277
- devops-ci-engineer.md
278
- code-reviewer.md
279
- .github/
280
- workflows/
281
- qfai.yml
282
- ```
312
+ ## Contributing (for QFAI maintainers)
283
313
 
284
- ## 開発
285
-
286
- ```sh
287
- pnpm install
288
- pnpm build
289
- pnpm format:check
290
- pnpm lint
291
- pnpm check-types
292
- pnpm test:assets
293
- ```
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).
294
315
 
295
- ## ライセンス
316
+ ## License
296
317
 
297
- [MIT](./LICENSE)
318
+ MIT
@@ -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)