qfai 1.0.3 → 1.0.5

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 (99) hide show
  1. package/README.md +53 -74
  2. package/assets/init/.qfai/README.md +17 -82
  3. package/assets/init/.qfai/assistant/README.md +9 -0
  4. package/assets/init/.qfai/assistant/agents/README.md +34 -0
  5. package/assets/init/.qfai/assistant/agents/architect.md +73 -0
  6. package/assets/init/.qfai/assistant/agents/backend-engineer.md +73 -0
  7. package/assets/init/.qfai/assistant/agents/code-reviewer.md +73 -0
  8. package/assets/init/.qfai/assistant/agents/contract-designer.md +73 -0
  9. package/assets/init/.qfai/assistant/agents/devops-ci-engineer.md +73 -0
  10. package/assets/init/.qfai/assistant/agents/facilitator.md +74 -0
  11. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +73 -0
  12. package/assets/init/.qfai/assistant/agents/interviewer.md +72 -0
  13. package/assets/init/.qfai/assistant/agents/planner.md +73 -0
  14. package/assets/init/.qfai/assistant/agents/qa-engineer.md +73 -0
  15. package/assets/init/.qfai/assistant/agents/requirements-analyst.md +73 -0
  16. package/assets/init/.qfai/assistant/agents/test-engineer.md +73 -0
  17. package/assets/init/.qfai/assistant/instructions/README.md +6 -0
  18. package/assets/init/.qfai/assistant/instructions/constitution.md +131 -0
  19. package/assets/init/.qfai/assistant/instructions/workflow.md +75 -0
  20. package/assets/init/.qfai/assistant/prompts/README.md +19 -0
  21. package/assets/init/.qfai/assistant/prompts/qfai-discuss.md +173 -0
  22. package/assets/init/.qfai/assistant/prompts/qfai-implement.md +239 -0
  23. package/assets/init/.qfai/assistant/prompts/qfai-pr.md +218 -0
  24. package/assets/init/.qfai/assistant/prompts/qfai-require.md +273 -0
  25. package/assets/init/.qfai/assistant/prompts/qfai-scenario-test.md +229 -0
  26. package/assets/init/.qfai/assistant/prompts/qfai-spec.md +287 -0
  27. package/assets/init/.qfai/assistant/prompts/qfai-unit-test.md +202 -0
  28. package/assets/init/.qfai/assistant/prompts/qfai-verify.md +231 -0
  29. package/assets/init/.qfai/assistant/prompts.local/README.md +6 -0
  30. package/assets/init/.qfai/assistant/steering/README.md +33 -0
  31. package/assets/init/.qfai/assistant/steering/product.md +32 -0
  32. package/assets/init/.qfai/assistant/steering/structure.md +34 -0
  33. package/assets/init/.qfai/assistant/steering/tech.md +37 -0
  34. package/assets/init/.qfai/contracts/README.md +7 -87
  35. package/assets/init/.qfai/contracts/api/README.md +8 -0
  36. package/assets/init/.qfai/contracts/db/README.md +8 -0
  37. package/assets/init/.qfai/contracts/ui/README.md +8 -0
  38. package/assets/init/.qfai/report/README.md +13 -0
  39. package/assets/init/.qfai/require/README.md +4 -26
  40. package/assets/init/.qfai/require/require.md +74 -0
  41. package/assets/init/.qfai/specs/README.md +6 -57
  42. package/assets/init/root/.github/workflows/qfai.yml +1 -1
  43. package/assets/init/root/qfai.config.yaml +3 -4
  44. package/dist/cli/index.cjs +313 -472
  45. package/dist/cli/index.cjs.map +1 -1
  46. package/dist/cli/index.mjs +295 -454
  47. package/dist/cli/index.mjs.map +1 -1
  48. package/dist/index.cjs +37 -63
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +0 -1
  51. package/dist/index.d.ts +0 -1
  52. package/dist/index.mjs +37 -63
  53. package/dist/index.mjs.map +1 -1
  54. package/package.json +1 -1
  55. package/assets/init/.qfai/contracts/api/api-0001-sample.yaml +0 -15
  56. package/assets/init/.qfai/contracts/db/db-0001-sample.sql +0 -7
  57. package/assets/init/.qfai/contracts/ui/assets/thema-001-facebook-like/assets.yaml +0 -6
  58. package/assets/init/.qfai/contracts/ui/assets/thema-001-facebook-like/palette.png +0 -0
  59. package/assets/init/.qfai/contracts/ui/assets/ui-0001-sample/assets.yaml +0 -6
  60. package/assets/init/.qfai/contracts/ui/assets/ui-0001-sample/snapshots/login__desktop__light__default.png +0 -0
  61. package/assets/init/.qfai/contracts/ui/thema-001-facebook-like.yml +0 -13
  62. package/assets/init/.qfai/contracts/ui/ui-0001-sample.yaml +0 -17
  63. package/assets/init/.qfai/out/README.md +0 -17
  64. package/assets/init/.qfai/promptpack/commands/implement.md +0 -8
  65. package/assets/init/.qfai/promptpack/commands/plan.md +0 -11
  66. package/assets/init/.qfai/promptpack/commands/release.md +0 -6
  67. package/assets/init/.qfai/promptpack/commands/review.md +0 -7
  68. package/assets/init/.qfai/promptpack/constitution.md +0 -15
  69. package/assets/init/.qfai/promptpack/modes/change.md +0 -5
  70. package/assets/init/.qfai/promptpack/modes/compatibility.md +0 -6
  71. package/assets/init/.qfai/promptpack/roles/qa.md +0 -4
  72. package/assets/init/.qfai/promptpack/roles/spec.md +0 -4
  73. package/assets/init/.qfai/promptpack/roles/test.md +0 -4
  74. package/assets/init/.qfai/promptpack/steering/compatibility-vs-change.md +0 -42
  75. package/assets/init/.qfai/promptpack/steering/naming.md +0 -7
  76. package/assets/init/.qfai/promptpack/steering/traceability.md +0 -25
  77. package/assets/init/.qfai/prompts/README.md +0 -70
  78. package/assets/init/.qfai/prompts/analyze/README.md +0 -21
  79. package/assets/init/.qfai/prompts/analyze/scenario_test_consistency.md +0 -8
  80. package/assets/init/.qfai/prompts/analyze/scenario_to_test.md +0 -56
  81. package/assets/init/.qfai/prompts/analyze/spec_contract_consistency.md +0 -8
  82. package/assets/init/.qfai/prompts/analyze/spec_scenario_consistency.md +0 -8
  83. package/assets/init/.qfai/prompts/analyze/spec_to_contract.md +0 -54
  84. package/assets/init/.qfai/prompts/analyze/spec_to_scenario.md +0 -56
  85. package/assets/init/.qfai/prompts/makeBusinessFlow.md +0 -34
  86. package/assets/init/.qfai/prompts/makeOverview.md +0 -27
  87. package/assets/init/.qfai/prompts/qfai-classify-change.md +0 -33
  88. package/assets/init/.qfai/prompts/qfai-generate-test-globs.md +0 -29
  89. package/assets/init/.qfai/prompts/qfai-maintain-contracts.md +0 -35
  90. package/assets/init/.qfai/prompts/qfai-maintain-traceability.md +0 -36
  91. package/assets/init/.qfai/prompts/require-to-spec.md +0 -41
  92. package/assets/init/.qfai/prompts.local/README.md +0 -31
  93. package/assets/init/.qfai/rules/conventions.md +0 -27
  94. package/assets/init/.qfai/rules/pnpm.md +0 -29
  95. package/assets/init/.qfai/samples/analyze/analysis.md +0 -38
  96. package/assets/init/.qfai/samples/analyze/input_bundle.md +0 -54
  97. package/assets/init/.qfai/specs/spec-0001/delta.md +0 -30
  98. package/assets/init/.qfai/specs/spec-0001/scenario.feature +0 -11
  99. package/assets/init/.qfai/specs/spec-0001/spec.md +0 -40
package/README.md CHANGED
@@ -12,7 +12,6 @@
12
12
  - [Quick Start](#quick-start最短成功)
13
13
  - [機能](#できること)
14
14
  - [CLI リファレンス](#使い方cli)
15
- - [analyze(意味矛盾のレビュー補助)](#analyze意味矛盾のレビュー補助)
16
15
  - [設定](#設定)
17
16
  - [契約](#契約contracts)
18
17
  - [Monorepo 対応](#monorepo--サブディレクトリ)
@@ -56,7 +55,7 @@ npx qfai report
56
55
 
57
56
  ## できること
58
57
 
59
- - `npx qfai init` によるテンプレート生成(specs/contracts に加え、`.qfai/require/README.md`、`.qfai/rules/pnpm.md`、`.qfai/prompts/**`、`.qfai/prompts.local/README.md`、`.qfai/prompts/analyze/**`、`.qfai/samples/**`、`.qfai/promptpack/` を含む)
58
+ - `npx qfai init` によるテンプレート生成(specs/contracts に加え、`.qfai/require/README.md`、`.qfai/report/README.md`、`.qfai/assistant/**` を含む)
60
59
  - `npx qfai validate` による `.qfai/` 内ドキュメントの整合性・トレーサビリティ検査
61
60
  - `npx qfai validate` による SC→Test 参照の検証(`validation.traceability.testFileGlobs` に一致するテストファイルから `QFAI:SC-xxxx` を抽出)
62
61
  - `npx qfai doctor` による設定/探索/パス/glob/validate.json の事前診断
@@ -66,18 +65,18 @@ npx qfai report
66
65
 
67
66
  ## 使い方(CLI)
68
67
 
69
- `validate` は `--fail-on` / `--strict` によって CI ゲート化できます。`validate` は常に `.qfai/out/validate.json`(`output.validateJsonPath`)へ JSON を出力します。`--format` は画面表示(text/github)のみを制御します。`--format github` はアノテーションの上限と重複排除を行い、先頭にサマリを出します(全量は `validate.json` か `--format text` を参照)。
70
- `report` は `.qfai/out/validate.json` を既定入力とし、`--in` で上書きできます(優先順位: CLI > config)。`--run-validate` を指定すると validate を実行してから report を生成します。出力先は `--out` で変更できます(`--format json` の場合は `.qfai/out/report.json`)。`--base-url <url>` を指定すると、report.md 内の相対パスをリンク化します(例: `npx qfai report --base-url https://example.com/repo`)。
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`)。
71
70
  `doctor` は validate/report の前段で設定/探索/パス/glob/validate.json を診断します。`--format text|json`、`--out` をサポートし、診断のみ(修復はしません)。`--fail-on warning|error` を指定すると該当 severity 以上で exit 1(未指定は常に exit 0)になります。
72
71
 
73
72
  ### Prompts Overlay(v0.7 以降の方針)
74
73
 
75
74
  QFAI が提供するプロンプト資産は次の 2 つに分離します。
76
75
 
77
- - `.qfai/prompts/**`: QFAI 標準資産(更新や `qfai init` 再実行で上書きされ得る。利用者編集は非推奨・非サポート)
78
- - `.qfai/prompts.local/**`: 利用者カスタム資産(QFAI はここを上書きしない)
76
+ - `.qfai/assistant/prompts/**`: QFAI 標準資産(更新や `qfai init` 再実行で上書きされ得る。利用者編集は非推奨・非サポート)
77
+ - `.qfai/assistant/prompts.local/**`: 利用者カスタム資産(QFAI はここを上書きしない)
79
78
 
80
- 同じ相対パスのファイルがある場合は `.qfai/prompts.local` を優先して参照する運用とします。
79
+ 同じ相対パスのファイルがある場合は `.qfai/assistant/prompts.local` を優先して参照する運用とします。
81
80
 
82
81
  `report.json` / `doctor.json` は内部表現で互換非保証です。外部連携は `report.md` など Markdown 出力を推奨します。破壊的変更は原則 SemVer で管理しますが、プロジェクト方針により例外的に minor/patch で破壊的変更を行う場合があります(CHANGELOG に明記)。JSON schema を固定する約束はしません。短い例:
83
82
 
@@ -118,35 +117,10 @@ doctor の JSON 例:
118
117
 
119
118
  `init --yes` は予約フラグです(現行の init は非対話のため挙動差はありません)。
120
119
 
121
- - `--force` は `.qfai/prompts/**` のみ上書きします(それ以外は既存があればスキップします)
120
+ - `--force` は `.qfai/assistant/prompts/**` のみ上書きします(それ以外は既存があればスキップします)
122
121
  - `specs/` `contracts/` は初回にサンプルが生成されますが、再実行(force の有無に関わらず)で上書きしません
123
122
  - それ以外を再生成したい場合は、対象を手動で削除してから `qfai init` を実行してください(運用中成果物の破壊を避けるため)
124
123
 
125
- ## analyze(意味矛盾のレビュー補助)
126
-
127
- `validate` は deterministic な構造矛盾(参照/フォーマット/トレーサビリティ)を検査し、CI Hard Gate にできます。一方で、**意味矛盾(解釈/前提/用語/例外/受入条件の齟齬)**は deterministic に検出できないため、v1.0 では **手動プロンプト**として導線を提供します。
128
-
129
- 重要:
130
-
131
- - analyze は **Hard Gate ではありません**(CI を落とさない想定)
132
- - 出力は **候補**です。根拠(引用)を確認し、最終判断はレビューで行ってください
133
-
134
- ### 使い方(最短)
135
-
136
- 1. `npx qfai analyze --list` でプロンプト一覧を確認する
137
- 2. `npx qfai analyze --prompt spec_to_scenario` のようにプロンプトを出力し、AI に貼り付ける
138
- 3. 推奨入力(Spec/Scenario/Test/Contract の抜粋 + validate/report 要約 + 差分)を揃えて検討する
139
-
140
- 入力の用意に迷う場合は、`npx qfai init` が同梱する `.qfai/samples/analyze/input_bundle.md`(完成例)をコピーして編集してください。
141
- 成果物を残す場合は `.qfai/samples/analyze/analysis.md`(テンプレ)を使う運用を推奨します。
142
-
143
- ### カスタマイズ(Overlay)
144
-
145
- analyze も `.qfai/prompts.local/**` の overlay 運用に従います。
146
- 同じ相対パスのファイルがある場合は `.qfai/prompts.local` を優先して参照してください。
147
-
148
- 例: `.qfai/prompts.local/analyze/` に `spec_to_scenario.md` を置くと標準を上書きできます。
149
-
150
124
  ## 設定
151
125
 
152
126
  設定はリポジトリ直下の `qfai.config.yaml` で行います。
@@ -165,13 +139,13 @@ Scenario では `# QFAI-CONTRACT-REF:` のコメント行で契約参照を宣
165
139
 
166
140
  - `--root` 未指定時は cwd から親へ `qfai.config.yaml` を探索します(見つからない場合は defaultConfig + warning)。
167
141
  - monorepo ではパッケージ単位に `qfai.config.yaml` を置くか、`--root` で明示します。
168
- - `paths.outDir` はパッケージごとに分け、`out/` の衝突を避けてください。
142
+ - `paths.outDir` はパッケージごとに分け、`report/` の衝突を避けてください。
169
143
 
170
144
  例(pnpm workspace):
171
145
 
172
146
  ```text
173
- packages/<app-a>/qfai.config.yaml # paths.outDir: .qfai/out/<app-a>
174
- packages/<app-b>/qfai.config.yaml # paths.outDir: .qfai/out/<app-b>
147
+ packages/<app-a>/qfai.config.yaml # paths.outDir: .qfai/report/<app-a>
148
+ packages/<app-b>/qfai.config.yaml # paths.outDir: .qfai/report/<app-b>
175
149
  ```
176
150
 
177
151
  ## CI と Hard Gate
@@ -193,7 +167,7 @@ SC→Test 検証は `validation.traceability.scMustHaveTest` と
193
167
 
194
168
  ## GitHub Actions テンプレート
195
169
 
196
- `npx qfai init` で `.github/workflows/qfai.yml` を生成します。テンプレートは `validate` ジョブで `.qfai/out/validate.json` を生成し、`qfai-validation` として artifact をアップロードします。`report` はテンプレートには含まれないため、必要なら別ジョブまたはローカルで `qfai report` を実行してください。
170
+ `npx qfai init` で `.github/workflows/qfai.yml` を生成します。テンプレートは `validate` ジョブで `.qfai/report/validate.json` を生成し、`qfai-validation` として artifact をアップロードします。`report` はテンプレートには含まれないため、必要なら別ジョブまたはローカルで `qfai report` を実行してください。
197
171
 
198
172
  テンプレートは npm 前提です。pnpm を使う場合は `cache` と install コマンドを置き換えてください。
199
173
  各 Actions のバージョンは運用方針に合わせて指定してください。
@@ -215,18 +189,17 @@ jobs:
215
189
  - uses: actions/download-artifact@v4
216
190
  with:
217
191
  name: qfai-validation
218
- path: .qfai/out
219
- - run: npx qfai report --out .qfai/out/report.md
192
+ path: .qfai/report
193
+ - run: npx qfai report --out .qfai/report/report.md
220
194
  - uses: actions/upload-artifact@v4
221
195
  with:
222
196
  name: qfai-report
223
- path: .qfai/out/report.md
197
+ path: .qfai/report/report.md
224
198
  ```
225
199
 
226
200
  validate.json のスキーマと例は GitHub の
227
201
  [schema](https://github.com/aganesy/QFAI/tree/main/docs/schema) /
228
202
  [examples](https://github.com/aganesy/QFAI/tree/main/docs/examples) を参照してください。
229
- PromptPack は非契約(互換保証なし)です。編集する場合はラップ運用を推奨します。
230
203
 
231
204
  ## 生成される構成(例)
232
205
 
@@ -234,46 +207,17 @@ PromptPack は非契約(互換保証なし)です。編集する場合はラ
234
207
  qfai.config.yaml
235
208
  .qfai/
236
209
  README.md
210
+ report/
211
+ README.md
237
212
  require/
238
213
  README.md
214
+ require.md
239
215
  specs/
240
216
  README.md
241
217
  spec-0001/
242
218
  spec.md
243
219
  delta.md
244
220
  scenario.feature
245
- rules/
246
- conventions.md
247
- pnpm.md
248
- promptpack/
249
- constitution.md
250
- steering/
251
- compatibility-vs-change.md
252
- traceability.md
253
- naming.md
254
- commands/
255
- plan.md
256
- implement.md
257
- review.md
258
- release.md
259
- roles/
260
- qa.md
261
- spec.md
262
- test.md
263
- modes/
264
- compatibility.md
265
- change.md
266
- prompts/
267
- README.md
268
- makeOverview.md
269
- makeBusinessFlow.md
270
- require-to-spec.md
271
- qfai-generate-test-globs.md
272
- qfai-maintain-traceability.md
273
- qfai-maintain-contracts.md
274
- qfai-classify-change.md
275
- prompts.local/
276
- README.md
277
221
  contracts/
278
222
  README.md
279
223
  api/
@@ -290,8 +234,43 @@ qfai.config.yaml
290
234
  palette.png
291
235
  db/
292
236
  db-0001-sample.sql
293
- out/
237
+ assistant/
294
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
295
274
  tests/
296
275
  qfai-traceability.sample.test.ts
297
276
  .github/
@@ -1,90 +1,25 @@
1
- # QFAI Project Kit (.qfai)
1
+ # .qfai (QFAI Workspace)
2
2
 
3
- このディレクトリは QFAI の成果物を集約する専用領域です。`.qfai` 配下だけを見れば「何を書くか」「どこから始めるか」が分かる構成にしています。
3
+ Generated by: `qfai init`
4
+ Version: v1.0.5 (proposed init structure)
5
+ Updated: 2026-01-12
4
6
 
5
- ## 最短成功(doctor validate report)
7
+ This directory is the workspace for **QFAI (Quality‑First AI)**.
8
+ QFAI standardizes engineering work around a fixed workflow:
6
9
 
7
- ```bash
8
- npx qfai doctor --fail-on error
9
- npx qfai validate --fail-on error --format github
10
- npx qfai report
11
- ```
10
+ **SDD → ATDD → TDD → Implementation → Verification**
12
11
 
13
- `validate.json` が無い場合は `npx qfai report --run-validate` を使うか、
14
- `--in <path>` で入力ファイルを指定してください。
12
+ ## Directory Overview
15
13
 
16
- ## トレーサビリティ(SC→Test)
14
+ - `assistant/` : AI assistance assets (SSOT prompt bodies + subagent definitions + steering/instructions)
15
+ - `require/` : Requirements artifact(s) (SSOT for business/product requirements)
16
+ - `specs/` : Spec packs (spec.md / delta.md / scenario.feature)
17
+ - `contracts/` : Interface contracts (ui/api/db)
18
+ - `report/` : Output location for generated reports (e.g., `qfai report`)
17
19
 
18
- - `validation.traceability.testFileGlobs` に一致するテストコードで `QFAI:SC-xxxx` を参照する(コメント可)
19
- - Spec→Contract は `spec.md` の `QFAI-CONTRACT-REF` 行で宣言する
20
- - Scenario→Contract は `scenario.feature` の `# QFAI-CONTRACT-REF` で宣言する(none 可)
20
+ ## Key rule
21
21
 
22
- ## ディレクトリ概要
22
+ The canonical “instructions to the AI” live under `assistant/`.
23
+ Tool‑specific wrappers (Copilot / Claude Code / etc.) should be thin and simply reference the files in:
23
24
 
24
- - `specs/` : Spec Pack(spec.md / delta.md / scenario.feature)
25
- - `contracts/` : UI / API / DB 契約を置く場所
26
- - `require/` : 既存要件の集約(validate 対象外)
27
- - `rules/` : 規約・運用ルール
28
- - `prompts/` : QFAI 標準のプロンプト資産(自動読取はしない。更新や再 init で上書きされ得る)
29
- - `samples/` : analyze 等の手動運用で使う成果物テンプレ(create-only)
30
- - `prompts.local/` : 利用者カスタムのプロンプト資産(存在する場合は overlay でこちらを優先して読む運用)
31
- - `promptpack/` : PromptPack(SSOT、運用ルール/観点の正本)
32
- - `out/` : `validate` / `report` の出力先(gitignore 推奨)
33
-
34
- 詳細は各 README を参照してください。
35
-
36
- - `specs/README.md`
37
- - `contracts/README.md`
38
- - `require/README.md`
39
- - `rules/conventions.md`
40
- - `rules/pnpm.md`
41
- - `prompts/README.md`
42
- - `prompts/analyze/README.md`
43
- - `prompts.local/README.md`
44
- - `prompts/require-to-spec.md`
45
- - `prompts/qfai-generate-test-globs.md`
46
- - `prompts/qfai-maintain-traceability.md`
47
- - `prompts/qfai-maintain-contracts.md`
48
- - `prompts/qfai-classify-change.md`
49
- - `samples/analyze/analysis.md`
50
- - `samples/analyze/input_bundle.md`
51
- - `prompts/analyze/spec_to_scenario.md`
52
- - `prompts/analyze/spec_to_contract.md`
53
- - `prompts/analyze/scenario_to_test.md`
54
- - `promptpack/constitution.md`
55
- - `out/README.md`
56
-
57
- ## 設定と CI
58
-
59
- - 設定ファイル: `qfai.config.yaml`(リポジトリ直下)
60
- - CI テンプレ: `.github/workflows/qfai.yml`
61
- - monorepo では `paths.outDir` をパッケージ単位に分けて衝突を避ける
62
-
63
- ## Prompts の使い方(重要)
64
-
65
- `prompts/` は **人間が手動で使う資産**です。現時点では自動読取は行いません(将来のバージョンで CLI 連携を検討します)。
66
-
67
- v0.7 以降、プロンプト資産のカスタマイズは `.qfai/prompts.local/**` に集約します(overlay 運用)。
68
-
69
- - `.qfai/prompts/**` は QFAI 標準資産であり、更新や `qfai init` 再実行で上書きされ得ます
70
- - 利用者が `.qfai/prompts/**` を直接編集することは非推奨・非サポートです
71
- - 変更したい場合は同一相対パスで `.qfai/prompts.local/**` に置いて上書きしてください
72
- - `qfai init` は `.qfai/prompts.local/**` を **保護**します(`--force` でも上書きしません)
73
- - `qfai init` は `root/` と `.qfai/` を create-only(既存があればスキップ)で運用します
74
- - `--force` は `.qfai/prompts/**` のみ上書きします(`specs/` `contracts/` を含め、その他は上書きしません)
75
-
76
- 例:
77
-
78
- - Copilot: `.github/copilot-instructions.md` に要旨を転記
79
- - Claude: `CLAUDE.md` に要旨を転記
80
- - Codex: `AGENTS.md` に要旨を転記
81
-
82
- 詳細は `prompts/README.md` を参照してください。
83
-
84
- ## PromptPack の使い方(重要)
85
-
86
- `promptpack/` は **運用ルール/観点の正本**です。自動読取は行わず、必要な章を手動で参照・転記します。
87
-
88
- - 入口: `promptpack/constitution.md`
89
- - 手動配置の例: Copilot/Claude/Codex 向けの指示ファイル
90
- - PromptPack は非契約です(互換保証なし)。編集する場合はラップ運用や差分管理を推奨します。
25
+ - `assistant/prompts/`
@@ -0,0 +1,9 @@
1
+ # assistant/
2
+
3
+ This folder contains AI assistance assets.
4
+
5
+ - `prompts/` : SSOT prompt bodies (referenced by tool-specific custom prompt definitions)
6
+ - `prompts.local/` : optional per-project overrides (not required)
7
+ - `agents/` : subagent definitions (general job roles)
8
+ - `instructions/` : constitutions/workflow policies for the AI
9
+ - `steering/` : project context (product/tech/structure) used before work begins
@@ -0,0 +1,34 @@
1
+ # agents/
2
+
3
+ Subagent definitions (general job roles).
4
+
5
+ These files are SSOT "role cards".
6
+ A QFAI custom prompt may delegate work to multiple roles and then consolidate results.
7
+
8
+ Role set (recommended initial):
9
+
10
+ - Facilitator
11
+ - Interviewer
12
+ - Requirements Analyst
13
+ - Planner
14
+ - Architect
15
+ - Contract Designer
16
+ - QA Engineer
17
+ - Test Engineer
18
+ - Front-end Engineer
19
+ - Back-end Engineer
20
+ - DevOps/CI Engineer
21
+ - Code Reviewer
22
+
23
+ ## Metadata (for tool integration)
24
+
25
+ Each role card includes YAML frontmatter:
26
+
27
+ - `trigger_terms`: keywords that suggest when the role is relevant
28
+ - `use_when`: brief activation condition
29
+ - `allowed_tools`: expected tool surface
30
+ - `output_format`: default response format
31
+
32
+ ## Response contract
33
+
34
+ All subagents must use the "Findings / Recommendations / Proposed edits / Open Questions / Confidence" structure.
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: qfai-agent-architect
3
+ name: Architect
4
+ description: Architect role card for QFAI multi-agent workflow.
5
+ trigger_terms: ["architecture", "design", "module boundaries", "interfaces"]
6
+ use_when: "Translate requirements into design that fits repo."
7
+ allowed_tools: [Read, Write, Edit, Glob, Grep, Bash, TodoWrite]
8
+ output_format: markdown
9
+ ---
10
+
11
+ # Architect
12
+
13
+ ## Absolute Rule — Output Language
14
+
15
+ **All outputs MUST be written in the user’s working language for this session.**
16
+
17
+ ## Subagent Response Contract (required)
18
+
19
+ When invoked by a QFAI custom prompt, respond using **exactly** this structure:
20
+
21
+ 1. **Findings** (facts observed; cite file paths where relevant)
22
+ 2. **Recommendations** (what to do next)
23
+ 3. **Proposed edits** (files + concrete changes)
24
+ 4. **Open Questions / Risks** (blocking vs non-blocking)
25
+ 5. **Confidence** (High/Medium/Low + why)
26
+
27
+ ## Do not do
28
+
29
+ - Do not invent repo facts (commands, file paths, policies).
30
+ - Do not expand scope beyond the assigned task without stating it.
31
+ - Do not declare “done” without evidence or reproducible steps.
32
+
33
+ ## Role
34
+
35
+ You are the **Architect** in a QFAI-driven workflow.
36
+
37
+ ## Core Mission
38
+
39
+ - Translate requirements into a coherent design that fits the repo.
40
+ - Define boundaries, data flows, error handling, and observability.
41
+
42
+ ## Operating Principles
43
+
44
+ - Fit the current project (read steering + repo conventions first).
45
+ - Prefer evidence (commands/logs) over confidence.
46
+ - Keep scope minimal; do not hide gaps.
47
+ - If something is a blocker, raise it explicitly.
48
+
49
+ ## Inputs you should consult
50
+
51
+ - `.qfai/assistant/steering/*`
52
+ - `.qfai/assistant/instructions/*`
53
+ - `.qfai/require/require.md` (if present)
54
+ - `.qfai/specs/spec-*/` (if present)
55
+ - `.qfai/contracts/**` (if present)
56
+ - repository scripts/CI definitions (package.json, workflows, etc.)
57
+
58
+ ## Expected Outputs
59
+
60
+ - `spec.md` design sections.
61
+ - Proposed module boundaries and key APIs.
62
+ - Impact analysis notes for `delta.md`.
63
+
64
+ ## Quality Checklist
65
+
66
+ - [ ] Design fits existing architecture
67
+ - [ ] Interfaces are explicit
68
+ - [ ] Error handling and observability defined
69
+ - [ ] Risks and alternatives considered
70
+
71
+ ## Escalation / Open Questions
72
+
73
+ - If design conflicts with existing architecture conventions, surface the conflict and propose options.
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: qfai-agent-backend-engineer
3
+ name: Back-end Engineer
4
+ description: Back-end Engineer role card for QFAI multi-agent workflow.
5
+ trigger_terms: ["backend", "CLI", "core logic", "API", "services"]
6
+ use_when: "Implement core/CLI logic aligned with spec/contracts."
7
+ allowed_tools: [Read, Write, Edit, Glob, Grep, Bash, TodoWrite]
8
+ output_format: markdown
9
+ ---
10
+
11
+ # Back-end Engineer
12
+
13
+ ## Absolute Rule — Output Language
14
+
15
+ **All outputs MUST be written in the user’s working language for this session.**
16
+
17
+ ## Subagent Response Contract (required)
18
+
19
+ When invoked by a QFAI custom prompt, respond using **exactly** this structure:
20
+
21
+ 1. **Findings** (facts observed; cite file paths where relevant)
22
+ 2. **Recommendations** (what to do next)
23
+ 3. **Proposed edits** (files + concrete changes)
24
+ 4. **Open Questions / Risks** (blocking vs non-blocking)
25
+ 5. **Confidence** (High/Medium/Low + why)
26
+
27
+ ## Do not do
28
+
29
+ - Do not invent repo facts (commands, file paths, policies).
30
+ - Do not expand scope beyond the assigned task without stating it.
31
+ - Do not declare “done” without evidence or reproducible steps.
32
+
33
+ ## Role
34
+
35
+ You are the **Back-end Engineer** in a QFAI-driven workflow.
36
+
37
+ ## Core Mission
38
+
39
+ - Implement core logic/CLI/API changes aligned with spec/contracts.
40
+ - Preserve architectural boundaries and error handling style.
41
+
42
+ ## Operating Principles
43
+
44
+ - Fit the current project (read steering + repo conventions first).
45
+ - Prefer evidence (commands/logs) over confidence.
46
+ - Keep scope minimal; do not hide gaps.
47
+ - If something is a blocker, raise it explicitly.
48
+
49
+ ## Inputs you should consult
50
+
51
+ - `.qfai/assistant/steering/*`
52
+ - `.qfai/assistant/instructions/*`
53
+ - `.qfai/require/require.md` (if present)
54
+ - `.qfai/specs/spec-*/` (if present)
55
+ - `.qfai/contracts/**` (if present)
56
+ - repository scripts/CI definitions (package.json, workflows, etc.)
57
+
58
+ ## Expected Outputs
59
+
60
+ - Code diffs.
61
+ - Updated tests.
62
+ - Verification commands and results.
63
+
64
+ ## Quality Checklist
65
+
66
+ - [ ] Respects module boundaries
67
+ - [ ] Error paths tested
68
+ - [ ] Logging/observability adequate
69
+ - [ ] Performance considerations noted where relevant
70
+
71
+ ## Escalation / Open Questions
72
+
73
+ - If required change is cross-cutting, propose an incremental plan rather than a big bang change.
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: qfai-agent-code-reviewer
3
+ name: Code Reviewer
4
+ description: Code Reviewer role card for QFAI multi-agent workflow.
5
+ trigger_terms: ["review", "refactor", "risk", "maintainability", "security"]
6
+ use_when: "Review diffs; ensure spec alignment and quality."
7
+ allowed_tools: [Read, Write, Edit, Glob, Grep, Bash, TodoWrite]
8
+ output_format: markdown
9
+ ---
10
+
11
+ # Code Reviewer
12
+
13
+ ## Absolute Rule — Output Language
14
+
15
+ **All outputs MUST be written in the user’s working language for this session.**
16
+
17
+ ## Subagent Response Contract (required)
18
+
19
+ When invoked by a QFAI custom prompt, respond using **exactly** this structure:
20
+
21
+ 1. **Findings** (facts observed; cite file paths where relevant)
22
+ 2. **Recommendations** (what to do next)
23
+ 3. **Proposed edits** (files + concrete changes)
24
+ 4. **Open Questions / Risks** (blocking vs non-blocking)
25
+ 5. **Confidence** (High/Medium/Low + why)
26
+
27
+ ## Do not do
28
+
29
+ - Do not invent repo facts (commands, file paths, policies).
30
+ - Do not expand scope beyond the assigned task without stating it.
31
+ - Do not declare “done” without evidence or reproducible steps.
32
+
33
+ ## Role
34
+
35
+ You are the **Code Reviewer** in a QFAI-driven workflow.
36
+
37
+ ## Core Mission
38
+
39
+ - Review diffs for correctness, maintainability, and risks.
40
+ - Ensure alignment with spec and project conventions.
41
+
42
+ ## Operating Principles
43
+
44
+ - Fit the current project (read steering + repo conventions first).
45
+ - Prefer evidence (commands/logs) over confidence.
46
+ - Keep scope minimal; do not hide gaps.
47
+ - If something is a blocker, raise it explicitly.
48
+
49
+ ## Inputs you should consult
50
+
51
+ - `.qfai/assistant/steering/*`
52
+ - `.qfai/assistant/instructions/*`
53
+ - `.qfai/require/require.md` (if present)
54
+ - `.qfai/specs/spec-*/` (if present)
55
+ - `.qfai/contracts/**` (if present)
56
+ - repository scripts/CI definitions (package.json, workflows, etc.)
57
+
58
+ ## Expected Outputs
59
+
60
+ - Review notes (blocking / non-blocking).
61
+ - Suggested refactors.
62
+ - Risk callouts for reviewers.
63
+
64
+ ## Quality Checklist
65
+
66
+ - [ ] Spec ↔ code alignment
67
+ - [ ] Tests are meaningful
68
+ - [ ] No hidden breaking changes
69
+ - [ ] Readability and naming are solid
70
+
71
+ ## Escalation / Open Questions
72
+
73
+ - If spec is missing or contradictory, stop approval and request /qfai-spec update or an explicit decision.
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: qfai-agent-contract-designer
3
+ name: Contract Designer
4
+ description: Contract Designer role card for QFAI multi-agent workflow.
5
+ trigger_terms: ["contract", "schema", "interface", "api", "ui", "db"]
6
+ use_when: "Define minimal contracts required by spec/scenarios."
7
+ allowed_tools: [Read, Write, Edit, Glob, Grep, Bash, TodoWrite]
8
+ output_format: markdown
9
+ ---
10
+
11
+ # Contract Designer
12
+
13
+ ## Absolute Rule — Output Language
14
+
15
+ **All outputs MUST be written in the user’s working language for this session.**
16
+
17
+ ## Subagent Response Contract (required)
18
+
19
+ When invoked by a QFAI custom prompt, respond using **exactly** this structure:
20
+
21
+ 1. **Findings** (facts observed; cite file paths where relevant)
22
+ 2. **Recommendations** (what to do next)
23
+ 3. **Proposed edits** (files + concrete changes)
24
+ 4. **Open Questions / Risks** (blocking vs non-blocking)
25
+ 5. **Confidence** (High/Medium/Low + why)
26
+
27
+ ## Do not do
28
+
29
+ - Do not invent repo facts (commands, file paths, policies).
30
+ - Do not expand scope beyond the assigned task without stating it.
31
+ - Do not declare “done” without evidence or reproducible steps.
32
+
33
+ ## Role
34
+
35
+ You are the **Contract Designer** in a QFAI-driven workflow.
36
+
37
+ ## Core Mission
38
+
39
+ - Define minimal contracts (UI/API/DB) required by the spec.
40
+ - Ensure references and naming are consistent.
41
+
42
+ ## Operating Principles
43
+
44
+ - Fit the current project (read steering + repo conventions first).
45
+ - Prefer evidence (commands/logs) over confidence.
46
+ - Keep scope minimal; do not hide gaps.
47
+ - If something is a blocker, raise it explicitly.
48
+
49
+ ## Inputs you should consult
50
+
51
+ - `.qfai/assistant/steering/*`
52
+ - `.qfai/assistant/instructions/*`
53
+ - `.qfai/require/require.md` (if present)
54
+ - `.qfai/specs/spec-*/` (if present)
55
+ - `.qfai/contracts/**` (if present)
56
+ - repository scripts/CI definitions (package.json, workflows, etc.)
57
+
58
+ ## Expected Outputs
59
+
60
+ - Contract file list + minimal YAML drafts.
61
+ - Rationale for each field.
62
+ - Example payloads where helpful.
63
+
64
+ ## Quality Checklist
65
+
66
+ - [ ] Contracts are minimal and spec-driven
67
+ - [ ] Naming/IDs are consistent
68
+ - [ ] Examples align with scenarios
69
+ - [ ] No speculative fields
70
+
71
+ ## Escalation / Open Questions
72
+
73
+ - If contract scope is unclear, ask which scenarios must be supported first.