qfai 1.0.6 → 1.1.0

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 (51) hide show
  1. package/README.md +327 -245
  2. package/assets/init/.qfai/README.md +2 -1
  3. package/assets/init/.qfai/assistant/README.md +1 -1
  4. package/assets/init/.qfai/assistant/prompts/README.md +1 -1
  5. package/assets/init/.qfai/assistant/prompts/qfai-configure.md +197 -0
  6. package/assets/init/.qfai/assistant/prompts/qfai-verify.md +1 -1
  7. package/assets/init/.qfai/assistant/steering/README.md +6 -0
  8. package/assets/init/.qfai/assistant/steering/manifest.md +43 -0
  9. package/assets/init/.qfai/contracts/db/README.md +10 -3
  10. package/assets/init/.qfai/samples/guardrails/delta_with_guardrails.md +19 -0
  11. package/assets/init/.qfai/specs/README.md +4 -0
  12. package/assets/init/root/.claude/commands/qfai-configure.md +14 -0
  13. package/assets/init/root/.claude/commands/qfai-discuss.md +14 -0
  14. package/assets/init/root/.claude/commands/qfai-implement.md +14 -0
  15. package/assets/init/root/.claude/commands/qfai-require.md +14 -0
  16. package/assets/init/root/.claude/commands/qfai-scenario-test.md +14 -0
  17. package/assets/init/root/.claude/commands/qfai-spec.md +14 -0
  18. package/assets/init/root/.claude/commands/qfai-unit-test.md +14 -0
  19. package/assets/init/root/.claude/commands/qfai-verify.md +14 -0
  20. package/assets/init/root/.codex/README.md +16 -0
  21. package/assets/init/root/.codex/skills/qfai-configure/SKILL.md +18 -0
  22. package/assets/init/root/.codex/skills/qfai-discuss/SKILL.md +18 -0
  23. package/assets/init/root/.codex/skills/qfai-implement/SKILL.md +18 -0
  24. package/assets/init/root/.codex/skills/qfai-require/SKILL.md +18 -0
  25. package/assets/init/root/.codex/skills/qfai-scenario-test/SKILL.md +18 -0
  26. package/assets/init/root/.codex/skills/qfai-spec/SKILL.md +18 -0
  27. package/assets/init/root/.codex/skills/qfai-unit-test/SKILL.md +18 -0
  28. package/assets/init/root/.codex/skills/qfai-verify/SKILL.md +18 -0
  29. package/assets/init/root/.github/copilot-instructions.md +14 -0
  30. package/assets/init/root/.github/prompts/qfai-configure.prompt.md +17 -0
  31. package/assets/init/root/.github/prompts/qfai-discuss.prompt.md +17 -0
  32. package/assets/init/root/.github/prompts/qfai-implement.prompt.md +17 -0
  33. package/assets/init/root/.github/prompts/qfai-require.prompt.md +17 -0
  34. package/assets/init/root/.github/prompts/qfai-scenario-test.prompt.md +17 -0
  35. package/assets/init/root/.github/prompts/qfai-spec.prompt.md +17 -0
  36. package/assets/init/root/.github/prompts/qfai-unit-test.prompt.md +17 -0
  37. package/assets/init/root/.github/prompts/qfai-verify.prompt.md +17 -0
  38. package/assets/init/root/.github/workflows/qfai.yml +0 -2
  39. package/assets/init/root/qfai.config.yaml +1 -8
  40. package/dist/cli/index.cjs +880 -196
  41. package/dist/cli/index.cjs.map +1 -1
  42. package/dist/cli/index.mjs +866 -182
  43. package/dist/cli/index.mjs.map +1 -1
  44. package/dist/index.cjs +731 -221
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +91 -1
  47. package/dist/index.d.ts +91 -1
  48. package/dist/index.mjs +719 -216
  49. package/dist/index.mjs.map +1 -1
  50. package/package.json +1 -1
  51. package/assets/init/.qfai/assistant/prompts/qfai-pr.md +0 -209
package/README.md CHANGED
@@ -1,297 +1,379 @@
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
- ## できること
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 for product/tech/structure/manifest), 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
+ - `npx qfai guardrails`
42
+ - Lists, extracts, or checks Decision Guardrails in `delta.md` (`list` / `extract` / `check`); use `--path` to point at samples or custom locations.
43
+
44
+ ## Operating model (prompt-driven workflow)
45
+
46
+ QFAI assumes you operate the project primarily via prepared custom prompts.
47
+ 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).
48
+ The agent reads QFAI assets under `.qfai/assistant/` and produces or updates SDD/ATDD/TDD artifacts and code.
49
+
50
+ ### Where the prompts live
51
+
52
+ - QFAI standard prompt bodies: `.qfai/assistant/prompts/**` (may be overwritten when you re-run `qfai init`).
53
+ - Your local overrides: `.qfai/assistant/prompts.local/**` (never overwritten by QFAI; prefer this for customizations).
54
+ - Rule: if the same relative path exists in both, treat `prompts.local/` as the higher-priority source.
55
+
56
+ ### Minimal custom prompt set
57
+
58
+ QFAI includes a small set of custom prompts (stored under `.qfai/assistant/prompts/`) designed to keep the workflow opinionated and repeatable.
59
+
60
+ - **qfai-configure**: Analyze the repository (language, frameworks, test layout, directory structure) and update steering (`product.md`, `tech.md`, `structure.md`, `manifest.md`) plus `qfai.config.yaml` with a minimal diff (especially `testFileGlobs`, and optionally `validation.require.specSections` when you want strict headings). Run this once right after `npx qfai init`, and re-run it when the repository structure changes or when you want to enforce required spec headings. Output: updated steering + YAML + validation checklist.
61
+ - **qfai-discuss**: Turn an idea into clear requirements by discussing scope, constraints, risks, and open questions.
62
+ - **qfai-require**: Produce `.qfai/require/require.md` from your idea or discussion output.
63
+ - **qfai-spec**: Produce `.qfai/specs/*` and `.qfai/contracts/*` from the requirements, including traceability scaffolding.
64
+ - **qfai-scenario-test**: Implement acceptance tests (ATDD) driven by specs/scenarios.
65
+ - **qfai-unit-test**: Implement unit tests (TDD) driven by specs/scenarios.
66
+ - **qfai-implement**: Implement the feature; iterate test→fix until all quality gates are green.
67
+ - **qfai-verify**: Run/interpret the local quality gates and produce a PR-ready summary.
68
+
69
+ ### Workflow sequence (example)
70
+
71
+ This sequence shows which prompt to run, in what order, and what artifacts to expect.
72
+
73
+ ```mermaid
74
+ sequenceDiagram
75
+ participant U as User
76
+ participant AG as AI Agent
77
+ participant Q as QFAI Kit (.qfai)
78
+ participant R as Repo (codebase)
79
+
80
+ U->>R: Create a repo (or open an existing one)
81
+ U->>R: Run npx qfai init
82
+ R-->>U: .qfai kit installed (prompts, instructions, agents)
83
+
84
+ U->>AG: Run /qfai-configure
85
+ AG->>Q: Read .qfai/assistant/prompts/qfai-configure.md
86
+ AG->>R: Update qfai.config.yaml (testFileGlobs, optional specSections)
87
+ AG-->>U: Config tuned to this repo
88
+
89
+ opt If you only have an idea
90
+ U->>AG: Run /qfai-discuss
91
+ AG-->>U: Clarified requirements (notes)
92
+ end
93
+
94
+ U->>AG: Run /qfai-require
95
+ AG->>Q: Read .qfai/assistant/prompts/qfai-require.md
96
+ AG->>R: Create/Update requirements docs
97
+ AG-->>U: Requirements ready
98
+
99
+ U->>AG: Run /qfai-spec
100
+ AG->>Q: Read .qfai/assistant/prompts/qfai-spec.md
101
+ AG->>R: Create specs + contracts + scenario.feature
102
+ AG-->>U: SDD artifacts ready
103
+
104
+ U->>AG: Run /qfai-scenario-test
105
+ AG->>Q: Read .qfai/assistant/prompts/qfai-scenario-test.md
106
+ AG->>R: Implement acceptance tests
107
+ AG-->>U: Scenario tests ready
108
+
109
+ U->>AG: Run /qfai-unit-test
110
+ AG->>Q: Read .qfai/assistant/prompts/qfai-unit-test.md
111
+ AG->>R: Implement unit tests
112
+ AG-->>U: Unit tests ready
113
+
114
+ U->>AG: Run /qfai-implement
115
+ AG->>Q: Read .qfai/assistant/prompts/qfai-implement.md
116
+ loop Implement and fix until green
117
+ AG->>R: Implement code changes
118
+ AG->>R: Run project tests locally
119
+ end
120
+ AG-->>U: Working implementation (quality gates passing)
121
+
122
+ U->>R: Run npx qfai validate
123
+ U->>R: Run npx qfai report
124
+ R-->>U: Traceability checks and report artifacts
125
+ ```
57
126
 
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` によるレポート出力
127
+ Operational notes.
63
128
 
64
- 補足: v1.x は日本語テンプレ中心で提供します。将来は英語を正本、日本語を別ドキュメントに切り替える方針です。
129
+ - Each custom prompt must output in the user’s language (absolute requirement).
130
+ - Except `qfai-discuss`, each prompt must analyze the project context (architecture, tech stack, test framework, repo structure) before generating artifacts or code.
131
+ - Prompts should delegate work to multiple role-based sub-agents (Planner, Architect, Contract Designer, QA, Code Reviewer, etc.) to emulate a real delivery flow.
65
132
 
66
- ## 使い方(CLI)
133
+ ## Configuration
67
134
 
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)になります。
135
+ Configuration is stored at the repository root as `qfai.config.yaml`.
136
+ Most projects only customize `paths` and `validation.traceability`.
137
+ `.qfai/require` is currently a fixed location (not configurable).
71
138
 
72
- ### Prompts Overlay(v0.7 以降の方針)
139
+ Example: a schema-valid configuration.
73
140
 
74
- QFAI が提供するプロンプト資産は次の 2 つに分離します。
141
+ ```yaml
142
+ paths:
143
+ specsDir: .qfai/specs
144
+ contractsDir: .qfai/contracts
145
+ outDir: .qfai/report
146
+ promptsDir: .qfai/assistant/prompts
147
+ srcDir: src
148
+ testsDir: tests
149
+
150
+ validation:
151
+ failOn: error # error | warning | never
152
+ traceability:
153
+ testFileGlobs:
154
+ - "src/**/*.test.ts"
155
+ - "tests/**/*.spec.ts"
156
+ testFileExcludeGlobs:
157
+ - "**/fixtures/**"
158
+ scMustHaveTest: true
159
+ scNoTestSeverity: warning # error | warning
160
+
161
+ output:
162
+ validateJsonPath: .qfai/report/validate.json
163
+ ```
75
164
 
76
- - `.qfai/assistant/prompts/**`: QFAI 標準資産(更新や `qfai init` 再実行で上書きされ得る。利用者編集は非推奨・非サポート)
77
- - `.qfai/assistant/prompts.local/**`: 利用者カスタム資産(QFAI はここを上書きしない)
165
+ ### Spec validation (BR lines and required sections)
78
166
 
79
- 同じ相対パスのファイルがある場合は `.qfai/assistant/prompts.local` を優先して参照する運用とします。
167
+ BR lines are required and must use the format `- [BR-0001][P1] ...` (priority P0-P3). Headings can be in any language.
168
+ `validation.require.specSections` controls required H2 section titles in `spec.md`. The default is an empty list to support multi-language specs.
169
+ If you want strict required headings, run `/qfai-configure` and specify your desired spec template headings.
80
170
 
81
- `report.json` / `doctor.json` は内部表現で互換非保証です。外部連携は `report.md` など Markdown 出力を推奨します。破壊的変更は原則 SemVer で管理しますが、プロジェクト方針により例外的に minor/patch で破壊的変更を行う場合があります(CHANGELOG に明記)。JSON schema を固定する約束はしません。短い例:
171
+ Example (Japanese):
82
172
 
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
- }
173
+ ```yaml
174
+ validation:
175
+ require:
176
+ specSections:
177
+ - 背景
178
+ - スコープ
179
+ - 非ゴール
180
+ - 用語
181
+ - 前提
182
+ - 決定事項
183
+ - 業務ルール
93
184
  ```
94
185
 
95
- doctor(text)の例:
186
+ Example (English):
96
187
 
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
- ```
102
-
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
- }
188
+ ```yaml
189
+ validation:
190
+ require:
191
+ specSections:
192
+ - Background
193
+ - Scope
194
+ - Non-goals
195
+ - Glossary
196
+ - Assumptions
197
+ - Decisions
198
+ - Business Rules
116
199
  ```
117
200
 
118
- `init --yes` は予約フラグです(現行の init は非対話のため挙動差はありません)。
201
+ Notes.
119
202
 
120
- - `--force` `.qfai/assistant/prompts/**` のみ上書きします(それ以外は既存があればスキップします)
121
- - `specs/` `contracts/` は初回にサンプルが生成されますが、再実行(force の有無に関わらず)で上書きしません
122
- - それ以外を再生成したい場合は、対象を手動で削除してから `qfai init` を実行してください(運用中成果物の破壊を避けるため)
203
+ - `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.
204
+ - `--strict` is a CLI option for `qfai validate` (treat warnings as failures); it is not a YAML setting.
205
+ - Scenario files are expected to use the Gherkin extension `*.feature` (not `*.md`).
123
206
 
124
- ## 設定
207
+ ## Specifications and contracts (SDD)
125
208
 
126
- 設定はリポジトリ直下の `qfai.config.yaml` で行います。
127
- 命名規約は GitHub の[命名規約ドキュメント](https://github.com/aganesy/QFAI/blob/main/docs/rules/naming.md)を参照してください。
209
+ QFAI uses a small, opinionated set of artifacts to reduce ambiguity and prevent agents from “inventing” behavior.
128
210
 
129
- ## 契約(Contracts)
211
+ - Requirements: what you want to achieve, constraints, and explicit non-goals.
212
+ - Specs: structured expected behaviors, inputs/outputs, edge cases, and invariants.
213
+ - Contracts:
214
+ - UI contracts: YAML (`.yaml` / `.yml`)
215
+ - API contracts: YAML (`.yaml` / `.yml`)
216
+ - DB contracts: SQL (`.sql`)
217
+ - Scenarios (ATDD): Gherkin `.feature` files
130
218
 
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 は出力しません)。
219
+ Traceability is validated across these artifacts, so code changes remain grounded in the specs and the tests prove compliance.
138
220
 
139
- ## Monorepo / サブディレクトリ
221
+ ## Continuous integration (GitHub Actions)
140
222
 
141
- - `--root` 未指定時は cwd から親へ `qfai.config.yaml` を探索します(見つからない場合は defaultConfig + warning)。
142
- - monorepo ではパッケージ単位に `qfai.config.yaml` を置くか、`--root` で明示します。
143
- - `paths.outDir` はパッケージごとに分け、`report/` の衝突を避けてください。
223
+ (GitHub Actions)
144
224
 
145
- 例(pnpm workspace):
225
+ `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.
146
226
 
147
- ```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>
150
- ```
227
+ What works out-of-the-box.
151
228
 
152
- ## CI Hard Gate
229
+ - The generated workflow runs without installing repository dependencies; it only executes `npx qfai validate --fail-on error`, so it works even if your repo is not a Node project.
230
+ - The default workflow does not enable `actions/setup-node` caching, so it does not require a lockfile.
231
+ - If you want to pin the QFAI version, install your repo dependencies (e.g., to run tests), or enable dependency caching, customize the workflow accordingly.
232
+ - The default validate gate fails only on `error`; use `--fail-on warning` or `--strict` if you want a stricter gate.
153
233
 
154
- - 「CIで検出する」= `validate` issue を出す(info/warning/error を含む)
155
- - 「Hard Gate」= `--fail-on error` で CI を停止する領域
156
- - Spec→下流参照禁止は Hard Gate にしない(検出する場合でも warning に留める)
234
+ Optional cache example (requires a lockfile):
157
235
 
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`)
236
+ ```yaml
237
+ - uses: actions/setup-node@v4
238
+ with:
239
+ node-version: 20
240
+ cache: npm
241
+ # cache-dependency-path: package-lock.json
242
+ ```
168
243
 
169
- ## GitHub Actions テンプレート
244
+ Typical customizations.
170
245
 
171
- `npx qfai init` `.github/workflows/qfai.yml` を生成します。テンプレートは `validate` ジョブで `.qfai/report/validate.json` を生成し、`qfai-validation` として artifact をアップロードします。`report` はテンプレートには含まれないため、必要なら別ジョブまたはローカルで `qfai report` を実行してください。
246
+ - Add a second job to generate `report.md` from the uploaded `validate.json`.
247
+ - Add a `doctor` step before validate if you want to fail fast on path/glob/config issues.
248
+ - Tune traceability globs in `qfai.config.yaml` to match your test layout.
172
249
 
173
- テンプレートは npm 前提です。pnpm を使う場合は `cache` と install コマンドを置き換えてください。
174
- 各 Actions のバージョンは運用方針に合わせて指定してください。
250
+ ## Generated structure
175
251
 
176
- 追加で `report` を回す場合の最小例:
252
+ `npx qfai init` generates the following structure in your repository.
177
253
 
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
254
+ ```text
255
+ .
256
+ ├── .claude
257
+ │ └── commands
258
+ │ ├── qfai-configure.md
259
+ │ ├── qfai-discuss.md
260
+ │ ├── qfai-implement.md
261
+ │ ├── qfai-require.md
262
+ │ ├── qfai-scenario-test.md
263
+ │ ├── qfai-spec.md
264
+ │ ├── qfai-unit-test.md
265
+ │ └── qfai-verify.md
266
+ ├── .codex
267
+ │ └── skills
268
+ │ ├── qfai-configure
269
+ │ │ └── SKILL.md
270
+ │ ├── qfai-discuss
271
+ │ │ └── SKILL.md
272
+ │ ├── qfai-implement
273
+ │ │ └── SKILL.md
274
+ │ ├── qfai-require
275
+ │ │ └── SKILL.md
276
+ │ ├── qfai-scenario-test
277
+ │ │ └── SKILL.md
278
+ │ ├── qfai-spec
279
+ │ │ └── SKILL.md
280
+ │ ├── qfai-unit-test
281
+ │ │ └── SKILL.md
282
+ │ └── qfai-verify
283
+ │ └── SKILL.md
284
+ ├── .github
285
+ │ ├── prompts
286
+ │ │ ├── qfai-configure.prompt.md
287
+ │ │ ├── qfai-discuss.prompt.md
288
+ │ │ ├── qfai-implement.prompt.md
289
+ │ │ ├── qfai-require.prompt.md
290
+ │ │ ├── qfai-scenario-test.prompt.md
291
+ │ │ ├── qfai-spec.prompt.md
292
+ │ │ ├── qfai-unit-test.prompt.md
293
+ │ │ └── qfai-verify.prompt.md
294
+ │ ├── workflows
295
+ │ │ └── qfai.yml
296
+ │ └── copilot-instructions.md
297
+ ├── .qfai
298
+ │ ├── assistant
299
+ │ │ ├── agents
300
+ │ │ │ ├── README.md
301
+ │ │ │ ├── architect.md
302
+ │ │ │ ├── backend-engineer.md
303
+ │ │ │ ├── code-reviewer.md
304
+ │ │ │ ├── contract-designer.md
305
+ │ │ │ ├── devops-ci-engineer.md
306
+ │ │ │ ├── facilitator.md
307
+ │ │ │ ├── frontend-engineer.md
308
+ │ │ │ ├── interviewer.md
309
+ │ │ │ ├── planner.md
310
+ │ │ │ ├── qa-engineer.md
311
+ │ │ │ ├── requirements-analyst.md
312
+ │ │ │ └── test-engineer.md
313
+ │ │ ├── instructions
314
+ │ │ │ ├── README.md
315
+ │ │ │ ├── agent-selection.md
316
+ │ │ │ ├── communication.md
317
+ │ │ │ ├── constitution.md
318
+ │ │ │ ├── quality.md
319
+ │ │ │ ├── thinking.md
320
+ │ │ │ └── workflow.md
321
+ │ │ ├── prompts
322
+ │ │ │ ├── README.md
323
+ │ │ │ ├── qfai-configure.md
324
+ │ │ │ ├── qfai-discuss.md
325
+ │ │ │ ├── qfai-implement.md
326
+ │ │ │ ├── qfai-require.md
327
+ │ │ │ ├── qfai-scenario-test.md
328
+ │ │ │ ├── qfai-spec.md
329
+ │ │ │ ├── qfai-unit-test.md
330
+ │ │ │ └── qfai-verify.md
331
+ │ │ ├── prompts.local
332
+ │ │ │ └── README.md
333
+ │ │ ├── steering
334
+ │ │ │ ├── README.md
335
+ │ │ │ ├── product.md
336
+ │ │ │ ├── structure.md
337
+ │ │ │ ├── manifest.md
338
+ │ │ │ └── tech.md
339
+ │ │ └── README.md
340
+ │ ├── contracts
341
+ │ │ ├── api
342
+ │ │ │ └── README.md
343
+ │ │ ├── db
344
+ │ │ │ └── README.md
345
+ │ │ ├── ui
346
+ │ │ │ └── README.md
347
+ │ │ └── README.md
348
+ │ ├── report
349
+ │ │ └── README.md
350
+ │ ├── require
351
+ │ │ ├── README.md
352
+ │ │ └── require.md
353
+ │ ├── specs
354
+ │ │ └── README.md
355
+ │ ├── samples
356
+ │ │ ├── guardrails
357
+ │ │ │ └── delta_with_guardrails.md
358
+ │ └── README.md
359
+ └── qfai.config.yaml
199
360
  ```
200
361
 
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) を参照してください。
362
+ ## Agent integrations (Copilot / Claude Code / Codex)
204
363
 
205
- ## 生成される構成(例)
364
+ `npx qfai init` also installs lightweight integration stubs so your AI coding agent can invoke QFAI custom prompts directly.
206
365
 
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
- ```
366
+ - **GitHub Copilot prompt files**: `.github/prompts/*.prompt.md` (invoke from Copilot Chat as `/qfai-...`).
367
+ - **GitHub Copilot repository instructions**: `.github/copilot-instructions.md` (baseline behavior guidance for Copilot in this repo).
368
+ - **Claude Code slash commands**: `.claude/commands/*.md` (invoke as `/qfai-...`).
369
+ - **OpenAI Codex skills**: `.codex/skills/*/SKILL.md` (invoke as Codex skills; each skill points to the canonical QFAI prompt).
283
370
 
284
- ## 開発
371
+ Each of these files is intentionally thin and forwards to the canonical source of truth under `.qfai/assistant/prompts/`.
285
372
 
286
- ```sh
287
- pnpm install
288
- pnpm build
289
- pnpm format:check
290
- pnpm lint
291
- pnpm check-types
292
- pnpm test:assets
293
- ```
373
+ ## Contributing (for QFAI maintainers)
374
+
375
+ 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
376
 
295
- ## ライセンス
377
+ ## License
296
378
 
297
- [MIT](./LICENSE)
379
+ MIT
@@ -1,7 +1,8 @@
1
1
  # .qfai (QFAI Workspace)
2
2
 
3
3
  Generated by: `qfai init`
4
- Template version: 1.0.6
4
+ Template version: 1.1.0
5
+ This kit is generated by the installed QFAI version. See the QFAI changelog for release details.
5
6
 
6
7
  This directory is the workspace for **QFAI (Quality‑First AI)**.
7
8
  QFAI standardizes engineering work around a fixed workflow:
@@ -6,4 +6,4 @@ This folder contains AI assistance assets.
6
6
  - `prompts.local/` : optional per-project overrides (not required)
7
7
  - `agents/` : subagent definitions (general job roles)
8
8
  - `instructions/` : constitutions/workflow policies for the AI
9
- - `steering/` : project context (product/tech/structure) used before work begins
9
+ - `steering/` : project context (product/tech/structure/manifest) used before work begins
@@ -10,10 +10,10 @@ Rule:
10
10
  Files:
11
11
 
12
12
  - qfai-discuss.md (optional)
13
+ - qfai-configure.md (run after init; updates steering + 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)