qfai 1.1.5 → 1.1.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 (34) hide show
  1. package/assets/init/.qfai/README.md +70 -17
  2. package/assets/init/.qfai/assistant/README.md +85 -7
  3. package/assets/init/.qfai/assistant/agents/README.md +104 -26
  4. package/assets/init/.qfai/assistant/agents/architect.md +6 -0
  5. package/assets/init/.qfai/assistant/agents/backend-engineer.md +6 -0
  6. package/assets/init/.qfai/assistant/agents/code-reviewer.md +6 -0
  7. package/assets/init/.qfai/assistant/agents/contract-designer.md +39 -0
  8. package/assets/init/.qfai/assistant/agents/devops-ci-engineer.md +6 -0
  9. package/assets/init/.qfai/assistant/agents/facilitator.md +6 -0
  10. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +6 -0
  11. package/assets/init/.qfai/assistant/agents/interviewer.md +6 -0
  12. package/assets/init/.qfai/assistant/agents/planner.md +6 -0
  13. package/assets/init/.qfai/assistant/agents/qa-engineer.md +6 -0
  14. package/assets/init/.qfai/assistant/agents/requirements-analyst.md +6 -0
  15. package/assets/init/.qfai/assistant/agents/test-engineer.md +6 -0
  16. package/assets/init/.qfai/assistant/instructions/README.md +77 -8
  17. package/assets/init/.qfai/assistant/prompts/README.md +103 -14
  18. package/assets/init/.qfai/assistant/prompts/qfai-discuss.md +15 -2
  19. package/assets/init/.qfai/assistant/prompts/qfai-require.md +6 -0
  20. package/assets/init/.qfai/assistant/prompts/qfai-spec.md +103 -19
  21. package/assets/init/.qfai/assistant/prompts.local/README.md +68 -5
  22. package/assets/init/.qfai/assistant/steering/README.md +125 -29
  23. package/assets/init/.qfai/contracts/README.md +53 -7
  24. package/assets/init/.qfai/contracts/api/README.md +85 -5
  25. package/assets/init/.qfai/contracts/db/README.md +47 -19
  26. package/assets/init/.qfai/contracts/ui/README.md +84 -5
  27. package/assets/init/.qfai/report/README.md +76 -8
  28. package/assets/init/.qfai/require/README.md +93 -4
  29. package/assets/init/.qfai/specs/README.md +152 -30
  30. package/dist/cli/index.cjs +2 -2
  31. package/dist/cli/index.mjs +2 -2
  32. package/dist/index.cjs +2 -2
  33. package/dist/index.mjs +2 -2
  34. package/package.json +1 -1
@@ -1,26 +1,79 @@
1
- # .qfai (QFAI Workspace)
1
+ # .qfai
2
2
 
3
- Generated by: `qfai init`
4
- This kit is generated by the installed QFAI version. See the QFAI changelog for release details.
3
+ ## 1. 目的
5
4
 
6
- This directory is the workspace for **QFAI (Quality‑First AI)**.
7
- QFAI standardizes engineering work around a fixed workflow:
5
+ `.qfai` QFAI が要件・仕様・契約・レポートを管理するためのワークスペースです。AI と人間が同じ前提で作業できるよう、成果物を決まった構造に揃えます。
8
6
 
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.
7
+ ## 2. 背景
10
8
 
11
- **SDD ATDD → TDD → Implementation → Verification**
9
+ 成果物の置き場や粒度が曖昧だと、AI がアドリブで不要な成果物を生成しやすく、検証(validate/verify)で弾けない曖昧さが残ります。`.qfai` はそのブレを抑えるための「成果物の骨格」です。
12
10
 
13
- ## Directory Overview
11
+ ## 3. ここに配置するもの
14
12
 
15
- - `assistant/` : AI assistance assets (SSOT prompt bodies + subagent definitions + steering/instructions)
16
- - `require/` : Requirements artifact(s) (SSOT for business/product requirements)
17
- - `specs/` : Spec packs (spec.md / delta.md / scenario.feature)
18
- - `contracts/` : Interface contracts (ui/api/db)
19
- - `report/` : Output location for generated reports (e.g., `qfai report`)
13
+ - AI の指示資産(assistant)
14
+ - 要求定義(require
15
+ - 契約(contracts)
16
+ - 仕様(specs)
17
+ - レポート(report
20
18
 
21
- ## Key rule
19
+ ## 4. ここに配置してはならないもの
22
20
 
23
- The canonical “instructions to the AI” live under `assistant/`.
24
- Tool‑specific wrappers (Copilot / Claude Code / etc.) should be thin and simply reference the files in:
21
+ - アプリのソースコード
22
+ - 生成されたテストコード
23
+ - 運用上の雑多なメモ(成果物の責務に属さないもの)
24
+ - README に定義されていない構造や成果物
25
25
 
26
- - `assistant/prompts/`
26
+ ## 5. ディレクトリ構造
27
+
28
+ ```text
29
+ .
30
+ ├─ README.md
31
+ ├─ assistant
32
+ │ ├─ README.md
33
+ │ ├─ agents
34
+ │ │ ├─ README.md
35
+ │ │ └─ <role files>
36
+ │ ├─ instructions
37
+ │ │ ├─ README.md
38
+ │ │ └─ <instruction files>
39
+ │ ├─ prompts
40
+ │ │ ├─ README.md
41
+ │ │ └─ <prompt files>
42
+ │ ├─ prompts.local
43
+ │ │ └─ README.md
44
+ │ └─ steering
45
+ │ ├─ README.md
46
+ │ └─ <steering files>
47
+ ├─ require
48
+ │ ├─ README.md
49
+ │ └─ require.md
50
+ ├─ contracts
51
+ │ ├─ README.md
52
+ │ ├─ api
53
+ │ │ ├─ README.md
54
+ │ │ └─ <api contracts>
55
+ │ ├─ db
56
+ │ │ ├─ README.md
57
+ │ │ └─ <db contracts>
58
+ │ └─ ui
59
+ │ ├─ README.md
60
+ │ └─ <ui contracts>
61
+ ├─ specs
62
+ │ ├─ README.md
63
+ │ └─ <spec packs>
64
+ └─ report
65
+ ├─ README.md
66
+ └─ <generated reports>
67
+ ```
68
+
69
+ ## 6. 運用ルール
70
+
71
+ - README は参照用ガイドです。通常は編集しません。
72
+ - README の不足や矛盾を見つけた場合は README を編集せず、Open Question として起票します。
73
+ - 作業は各ディレクトリの README のチェックリストに従います。
74
+
75
+ ## 7. チェックリスト
76
+
77
+ - [ ] 作業対象ディレクトリの README を読んだ
78
+ - [ ] 成果物を所定のディレクトリに配置した
79
+ - [ ] validate/verify のチェックコマンドを実行し、全て通過した
@@ -1,9 +1,87 @@
1
- # assistant/
1
+ # assistant
2
2
 
3
- This folder contains AI assistance assets.
3
+ ## 1. 目的
4
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/manifest) used before work begins
5
+ `assistant` AI が成果物を作成するときに参照する指示資産の置き場です。プロジェクト固有の前提と作業手順をここに揃えます。
6
+
7
+ ## 2. 背景
8
+
9
+ 同じ指示でも、散在すると参照漏れや解釈ブレが発生します。`assistant` SSOT として整理し、プロンプトやサブエージェントの行動を安定化させます。
10
+
11
+ ## 3. ここに配置するもの
12
+
13
+ - prompts: コマンド別の作業指示(SSOT)
14
+ - prompts.local: 必要に応じた上書き(最小限)
15
+ - agents: サブエージェントの役割定義
16
+ - instructions: 行動規範・品質基準・ワークフロー
17
+ - steering: プロジェクト文脈(前提・制約・方針)
18
+
19
+ ## 4. ここに配置してはならないもの
20
+
21
+ - requirements/specs/contracts の成果物
22
+ - 実装コード
23
+ - 手順のない雑多なメモ
24
+
25
+ ## 5. ディレクトリ構造
26
+
27
+ ```text
28
+ .
29
+ ├─ README.md
30
+ ├─ prompts
31
+ │ └─ README.md
32
+ ├─ prompts.local
33
+ │ └─ README.md
34
+ ├─ agents
35
+ │ └─ README.md
36
+ ├─ instructions
37
+ │ └─ README.md
38
+ └─ steering
39
+ └─ README.md
40
+ ```
41
+
42
+ ## 6. テンプレート
43
+
44
+ 指示ファイルは原則「ルール」「手順」「チェックリスト」を含めます。
45
+
46
+ ```md
47
+ # Title
48
+
49
+ ## Rules
50
+
51
+ - <must>
52
+
53
+ ## Steps
54
+
55
+ 1. <do>
56
+
57
+ ## Checklist
58
+
59
+ - [ ] <check>
60
+ ```
61
+
62
+ ## 7. 完成例
63
+
64
+ ```md
65
+ # Example
66
+
67
+ ## Rules
68
+
69
+ - 出力ファイルのパスを必ず明記する
70
+ - 作業完了条件としてチェックコマンドを実行する
71
+
72
+ ## Steps
73
+
74
+ 1. 入力を読む
75
+ 2. 成果物を生成する
76
+ 3. チェックコマンドを実行する
77
+
78
+ ## Checklist
79
+
80
+ - [ ] 出力パスが明記されている
81
+ - [ ] チェックコマンドを全て通過した
82
+ ```
83
+
84
+ ## 8. チェックリスト
85
+
86
+ - [ ] 成果物を `assistant` に置いていない(責務分離)
87
+ - [ ] 指示は検証可能な形(チェックリスト)になっている
@@ -1,36 +1,114 @@
1
- # agents/
1
+ # agents
2
2
 
3
- Subagent definitions (general job roles).
3
+ ## 1. 目的
4
4
 
5
- These files are SSOT "role cards".
6
- A QFAI custom prompt may delegate work to multiple roles and then consolidate results.
5
+ `agents` はサブエージェントの役割定義を格納します。作業を分担し、各成果物の責務と判断基準を明確化します。
7
6
 
8
- Role set (recommended initial):
7
+ ## 2. 背景
9
8
 
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
9
+ 単一プロンプトで全てを決めると、論点の取りこぼしや品質ムラが発生します。役割定義により、検討・作成・レビューを分離して安定化させます。
22
10
 
23
- ## Metadata (for tool integration)
11
+ ## 3. ここに配置するもの
24
12
 
25
- Each role card includes YAML frontmatter:
13
+ - 役割定義ファイル(Markdown)
14
+ - 役割ごとの Mission / Non-goals / Working rules / Output format
26
15
 
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
16
+ ## 4. ここに配置してはならないもの
31
17
 
32
- ## Response contract
18
+ - 要件や仕様そのもの
19
+ - 実装コード
20
+ - プロジェクト固有の前提(それは steering)
33
21
 
34
- All subagents must use the "Findings / Recommendations / Proposed edits / Open Questions / Confidence" structure.
22
+ ## 5. ディレクトリ構造
35
23
 
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.
24
+ ```text
25
+ .
26
+ ├─ README.md
27
+ ├─ facilitator.md
28
+ ├─ interviewer.md
29
+ ├─ requirements-analyst.md
30
+ ├─ planner.md
31
+ ├─ architect.md
32
+ ├─ contract-designer.md
33
+ ├─ qa-engineer.md
34
+ ├─ test-engineer.md
35
+ ├─ frontend-engineer.md
36
+ ├─ backend-engineer.md
37
+ ├─ devops-ci-engineer.md
38
+ └─ code-reviewer.md
39
+ ```
40
+
41
+ ## 6. テンプレート
42
+
43
+ ```md
44
+ ---
45
+ trigger_terms:
46
+ - <keyword>
47
+ use_when: <condition>
48
+ output_format: markdown
49
+ ---
50
+
51
+ # Role name
52
+
53
+ ## Mission
54
+
55
+ - <responsibilities>
56
+
57
+ ## Non-goals
58
+
59
+ - <not doing>
60
+
61
+ ## Working rules
62
+
63
+ - <must>
64
+ - <must not>
65
+
66
+ ## Output format
67
+
68
+ - Findings:
69
+ - Recommendations:
70
+ - Proposed edits:
71
+ - Open Questions:
72
+ - Confidence:
73
+ ```
74
+
75
+ ## 7. 完成例
76
+
77
+ ```md
78
+ ---
79
+ trigger_terms:
80
+ - contract
81
+ use_when: contracts を作るとき
82
+ output_format: markdown
83
+ ---
84
+
85
+ # Contract Designer
86
+
87
+ ## Mission
88
+
89
+ - API/DB/UI の契約を先に定義し、spec が架空参照しないようにする
90
+ - YAML/SQL の構文を正しく保つ
91
+
92
+ ## Non-goals
93
+
94
+ - 実装の技術選定を決めない
95
+
96
+ ## Working rules
97
+
98
+ - カテゴリ(api/db/ui)を増やさない
99
+ - テンプレと命名規約を守る
100
+ - 不明点は Open Question にする
101
+
102
+ ## Output format
103
+
104
+ - Findings:
105
+ - Recommendations:
106
+ - Proposed edits:
107
+ - Open Questions:
108
+ - Confidence:
109
+ ```
110
+
111
+ ## 8. チェックリスト
112
+
113
+ - [ ] Mission と Non-goals が分離している
114
+ - [ ] Working rules が明確で検証可能
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -38,6 +44,26 @@ You are the **Contract Designer** in a QFAI-driven workflow.
38
44
 
39
45
  - Define minimal contracts (UI/API/DB) required by the spec.
40
46
  - Ensure references and naming are consistent.
47
+ - **Ensure all contract files referenced by specs actually exist** (reference integrity).
48
+ - If the spec slice has UI, API, or DB, the corresponding contract category MUST have at least one file (not just README).
49
+
50
+ ## Required Deliverables (by category)
51
+
52
+ For each spec slice, evaluate and create contracts as needed:
53
+
54
+ - **UI contracts** (`contracts/ui/`): Required if the slice includes screens, forms, or components.
55
+ - **API contracts** (`contracts/api/`): Required if the slice includes API endpoints.
56
+ - **DB contracts** (`contracts/db/`): Required if the slice includes database schema/tables.
57
+
58
+ If a category is applicable but no contract exists, CREATE the contract before the spec is finalized.
59
+
60
+ ## Prohibited Actions
61
+
62
+ - Do NOT create new contract categories (e.g., `contracts/infra/`). Allowed: `api/`, `db/`, `ui/` only.
63
+ - Do NOT write Markdown syntax into YAML files (`#` comments are OK; `#` headings and ``` fences are NOT).
64
+ - Do NOT invent technologies (DB types, external APIs, auth methods) not confirmed in steering/require.
65
+ - Do NOT create `.qfai/samples/**`.
66
+ - If technology is unclear, use `QFAI-CONTRACT-REF: none` and raise an Open Question.
41
67
 
42
68
  ## Operating Principles
43
69
 
@@ -67,6 +93,19 @@ You are the **Contract Designer** in a QFAI-driven workflow.
67
93
  - [ ] Naming/IDs are consistent
68
94
  - [ ] Examples align with scenarios
69
95
  - [ ] No speculative fields
96
+ - [ ] All contract files have `QFAI-CONTRACT-ID:` header (YAML: `# QFAI-CONTRACT-ID: ...`, SQL: `-- QFAI-CONTRACT-ID: ...`)
97
+ - [ ] YAML files parse without syntax errors
98
+ - [ ] No Markdown in YAML (no `#` headings, no ``` fences)
99
+ - [ ] Only allowed categories used: `api/`, `db/`, `ui/`
100
+ - [ ] UI contracts exist if the spec has UI elements
101
+ - [ ] API contracts exist if the spec has API endpoints
102
+ - [ ] DB contracts exist if the spec has DB schema
103
+
104
+ ## Completion Criteria
105
+
106
+ - All contract files referenced by `spec.md` exist (missing = 0).
107
+ - All contract files are syntactically valid.
108
+ - Contract Designer signs off only after all checks pass.
70
109
 
71
110
  ## Escalation / Open Questions
72
111
 
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -15,6 +15,12 @@ output_format: markdown
15
15
 
16
16
  **All outputs MUST be written in the user’s working language for this session.**
17
17
 
18
+ ## README Rule
19
+
20
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
21
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
22
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
23
+
18
24
  ## Subagent Response Contract (required)
19
25
 
20
26
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -14,6 +14,12 @@ output_format: markdown
14
14
 
15
15
  **All outputs MUST be written in the user’s working language for this session.**
16
16
 
17
+ ## README Rule
18
+
19
+ - `.qfai/**/README.md` is a reference guide. Do NOT edit README files.
20
+ - If you find a gap or inconsistency in a README, do NOT modify it. Instead, record an **Open Question**.
21
+ - Before starting work, read the README of the target directory and follow its structure, templates, and checklist.
22
+
17
23
  ## Subagent Response Contract (required)
18
24
 
19
25
  When invoked by a QFAI custom prompt, respond using **exactly** this structure:
@@ -1,10 +1,79 @@
1
- # instructions/
1
+ # instructions
2
2
 
3
- High-level governance for AI behavior in QFAI.
3
+ ## 1. 目的
4
4
 
5
- - `constitution.md` : non-negotiable rules (quality, traceability, evidence)
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)
5
+ `instructions` AI の行動規範、品質基準、標準ワークフローを定義します。成果物の粒度と検証手順を揃えます。
6
+
7
+ ## 2. 背景
8
+
9
+ 品質基準が曖昧だと、spec pack の粒度が粗くなり、verify で保証できない曖昧さが残ります。`instructions` はそれを防ぎます。
10
+
11
+ ## 3. ここに配置するもの
12
+
13
+ - constitution: 絶対に守るルール
14
+ - workflow: 標準ワークフロー
15
+ - quality: 品質ゲートと受入基準
16
+ - thinking: 曖昧さ解消と根拠の書き方
17
+ - communication: 報告フォーマット
18
+ - agent-selection: ロール分担方針
19
+
20
+ ## 4. ここに配置してはならないもの
21
+
22
+ - プロジェクト固有の事実(steering へ)
23
+ - コマンド別の細かな手順(prompts へ)
24
+
25
+ ## 5. ディレクトリ構造
26
+
27
+ ```text
28
+ .
29
+ ├─ README.md
30
+ ├─ constitution.md
31
+ ├─ workflow.md
32
+ ├─ quality.md
33
+ ├─ thinking.md
34
+ ├─ communication.md
35
+ └─ agent-selection.md
36
+ ```
37
+
38
+ ## 6. テンプレート
39
+
40
+ ```md
41
+ # Title
42
+
43
+ ## Rules
44
+
45
+ - <must>
46
+
47
+ ## Rationale
48
+
49
+ - <why>
50
+
51
+ ## Checklist
52
+
53
+ - [ ] <check>
54
+ ```
55
+
56
+ ## 7. 完成例
57
+
58
+ ```md
59
+ # Quality
60
+
61
+ ## Rules
62
+
63
+ - spec pack は 1 主要スライスのみ
64
+ - scenario.feature は 1 ファイル 1 シナリオ
65
+
66
+ ## Rationale
67
+
68
+ - 粒度が粗いと実装がアドリブ化し、トレーサビリティが崩れる
69
+
70
+ ## Checklist
71
+
72
+ - [ ] scenario.feature に Scenario が 1 つだけ
73
+ - [ ] spec.md の BR が 1 つだけ
74
+ ```
75
+
76
+ ## 8. チェックリスト
77
+
78
+ - [ ] ルールが定量的、または明確な判断基準として書かれている
79
+ - [ ] 出力の作業完了条件にチェックコマンドが含まれている