create-ai-project 1.11.2 → 1.12.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.
- package/.claude/agents/acceptance-test-generator.md +179 -245
- package/.claude/agents/code-reviewer.md +3 -9
- package/.claude/agents/design-sync.md +221 -0
- package/.claude/agents/document-reviewer.md +15 -10
- package/.claude/agents/integration-test-reviewer.md +192 -0
- package/.claude/agents/prd-creator.md +10 -6
- package/.claude/agents/quality-fixer-frontend.md +324 -0
- package/.claude/agents/quality-fixer.md +48 -62
- package/.claude/agents/requirement-analyzer.md +8 -8
- package/.claude/agents/rule-advisor.md +84 -103
- package/.claude/agents/task-decomposer.md +21 -27
- package/.claude/agents/task-executor-frontend.md +264 -0
- package/.claude/agents/task-executor.md +4 -16
- package/.claude/agents/technical-designer-frontend.md +444 -0
- package/.claude/agents/technical-designer.md +52 -27
- package/.claude/agents/work-planner.md +41 -14
- package/.claude/agents-en/acceptance-test-generator.md +13 -13
- package/.claude/agents-en/code-reviewer.md +8 -10
- package/.claude/agents-en/design-sync.md +6 -5
- package/.claude/agents-en/document-reviewer.md +8 -7
- package/.claude/agents-en/integration-test-reviewer.md +5 -4
- package/.claude/agents-en/prd-creator.md +7 -6
- package/.claude/agents-en/quality-fixer-frontend.md +3 -14
- package/.claude/agents-en/quality-fixer.md +9 -20
- package/.claude/agents-en/requirement-analyzer.md +8 -7
- package/.claude/agents-en/rule-advisor.md +57 -128
- package/.claude/agents-en/task-decomposer.md +4 -10
- package/.claude/agents-en/task-executor-frontend.md +4 -16
- package/.claude/agents-en/task-executor.md +5 -16
- package/.claude/agents-en/technical-designer-frontend.md +17 -15
- package/.claude/agents-en/technical-designer.md +13 -15
- package/.claude/agents-en/work-planner.md +9 -14
- package/.claude/agents-ja/acceptance-test-generator.md +9 -15
- package/.claude/agents-ja/code-reviewer.md +3 -11
- package/.claude/agents-ja/design-sync.md +2 -6
- package/.claude/agents-ja/document-reviewer.md +4 -9
- package/.claude/agents-ja/integration-test-reviewer.md +2 -5
- package/.claude/agents-ja/prd-creator.md +3 -7
- package/.claude/agents-ja/quality-fixer-frontend.md +2 -13
- package/.claude/agents-ja/quality-fixer.md +7 -18
- package/.claude/agents-ja/requirement-analyzer.md +5 -8
- package/.claude/agents-ja/rule-advisor.md +57 -128
- package/.claude/agents-ja/task-decomposer.md +4 -10
- package/.claude/agents-ja/task-executor-frontend.md +3 -15
- package/.claude/agents-ja/task-executor.md +3 -17
- package/.claude/agents-ja/technical-designer-frontend.md +17 -15
- package/.claude/agents-ja/technical-designer.md +13 -15
- package/.claude/agents-ja/work-planner.md +9 -14
- package/.claude/commands/build.md +7 -10
- package/.claude/commands/design.md +15 -5
- package/.claude/commands/front-build.md +103 -0
- package/.claude/commands/front-design.md +42 -0
- package/.claude/commands/front-plan.md +40 -0
- package/.claude/commands/implement.md +23 -29
- package/.claude/commands/plan.md +4 -4
- package/.claude/commands/project-inject.md +4 -4
- package/.claude/{commands-ja/refine-rule.md → commands/refine-skill.md} +25 -25
- package/.claude/{commands-ja/sync-rules.md → commands/sync-skills.md} +28 -28
- package/.claude/commands/task.md +1 -1
- package/.claude/commands-en/build.md +2 -2
- package/.claude/commands-en/design.md +1 -1
- package/.claude/commands-en/implement.md +8 -8
- package/.claude/commands-en/plan.md +3 -3
- package/.claude/commands-en/project-inject.md +4 -4
- package/.claude/commands-en/{refine-rule.md → refine-skill.md} +47 -48
- package/.claude/commands-en/{sync-rules.md → sync-skills.md} +29 -29
- package/.claude/commands-ja/build.md +2 -2
- package/.claude/commands-ja/design.md +1 -1
- package/.claude/commands-ja/implement.md +8 -8
- package/.claude/commands-ja/plan.md +3 -3
- package/.claude/commands-ja/project-inject.md +4 -4
- package/.claude/{commands/refine-rule.md → commands-ja/refine-skill.md} +25 -25
- package/.claude/{commands/sync-rules.md → commands-ja/sync-skills.md} +28 -28
- package/.claude/settings.local.json +21 -1
- package/{docs/rules/ai-development-guide.md → .claude/skills/coding-standards/SKILL.md} +94 -108
- package/{docs/rules/documentation-criteria.md → .claude/skills/documentation-criteria/SKILL.md} +19 -6
- package/.claude/skills/documentation-criteria/references/adr-template.md +64 -0
- package/.claude/skills/documentation-criteria/references/design-template.md +242 -0
- package/.claude/skills/documentation-criteria/references/plan-template.md +130 -0
- package/.claude/skills/documentation-criteria/references/prd-template.md +109 -0
- package/.claude/skills/frontend/technical-spec/SKILL.md +147 -0
- package/.claude/skills/frontend/typescript-rules/SKILL.md +315 -0
- package/.claude/skills/frontend/typescript-testing/SKILL.md +212 -0
- package/{docs/rules-ja/architecture/implementation-approach.md → .claude/skills/implementation-approach/SKILL.md} +10 -5
- package/.claude/skills/integration-e2e-testing/SKILL.md +146 -0
- package/{docs/rules-ja/project-context.md → .claude/skills/project-context/SKILL.md} +7 -3
- package/.claude/skills/subagents-orchestration-guide/SKILL.md +212 -0
- package/.claude/skills/task-analyzer/SKILL.md +142 -0
- package/.claude/skills/task-analyzer/references/skills-index.yaml +211 -0
- package/.claude/skills/technical-spec/SKILL.md +86 -0
- package/{docs/rules/typescript.md → .claude/skills/typescript-rules/SKILL.md} +22 -67
- package/.claude/skills/typescript-testing/SKILL.md +155 -0
- package/{docs/rules-en/coding-standards.md → .claude/skills-en/coding-standards/SKILL.md} +21 -108
- package/{docs/rules-en/documentation-criteria.md → .claude/skills-en/documentation-criteria/SKILL.md} +40 -42
- package/{docs/adr/template-en.md → .claude/skills-en/documentation-criteria/references/adr-template.md} +1 -1
- package/{docs/design/template-en.md → .claude/skills-en/documentation-criteria/references/design-template.md} +11 -31
- package/{docs/plans/template-en.md → .claude/skills-en/documentation-criteria/references/plan-template.md} +4 -4
- package/{docs/prd/template-en.md → .claude/skills-en/documentation-criteria/references/prd-template.md} +1 -1
- package/{docs/rules-en/frontend/technical-spec.md → .claude/skills-en/frontend/technical-spec/SKILL.md} +17 -13
- package/{docs/rules-en/frontend/typescript.md → .claude/skills-en/frontend/typescript-rules/SKILL.md} +17 -12
- package/{docs/rules-en/frontend/typescript-testing.md → .claude/skills-en/frontend/typescript-testing/SKILL.md} +11 -6
- package/{docs/rules-en/architecture/implementation-approach.md → .claude/skills-en/implementation-approach/SKILL.md} +7 -2
- package/{docs/rules-en/integration-e2e-testing.md → .claude/skills-en/integration-e2e-testing/SKILL.md} +15 -18
- package/{docs/rules-en/project-context.md → .claude/skills-en/project-context/SKILL.md} +7 -3
- package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +224 -0
- package/.claude/skills-en/task-analyzer/SKILL.md +131 -0
- package/{docs/rules-en/rules-index.yaml → .claude/skills-en/task-analyzer/references/skills-index.yaml} +34 -20
- package/{docs/rules-en/technical-spec.md → .claude/skills-en/technical-spec/SKILL.md} +6 -6
- package/{docs/rules-en/typescript.md → .claude/skills-en/typescript-rules/SKILL.md} +15 -10
- package/{docs/rules-en/typescript-testing.md → .claude/skills-en/typescript-testing/SKILL.md} +10 -4
- package/{docs/rules-ja/coding-standards.md → .claude/skills-ja/coding-standards/SKILL.md} +12 -99
- package/{docs/rules-ja/documentation-criteria.md → .claude/skills-ja/documentation-criteria/SKILL.md} +18 -5
- package/.claude/skills-ja/documentation-criteria/references/adr-template.md +64 -0
- package/.claude/skills-ja/documentation-criteria/references/design-template.md +261 -0
- package/{docs/plans/template-ja.md → .claude/skills-ja/documentation-criteria/references/plan-template.md} +38 -38
- package/{docs/prd/template-ja.md → .claude/skills-ja/documentation-criteria/references/prd-template.md} +33 -33
- package/{docs/rules-ja/frontend/technical-spec.md → .claude/skills-ja/frontend/technical-spec/SKILL.md} +13 -9
- package/.claude/skills-ja/frontend/typescript-rules/SKILL.md +315 -0
- package/{docs/rules-ja/frontend/typescript-testing.md → .claude/skills-ja/frontend/typescript-testing/SKILL.md} +93 -5
- package/{docs/rules/architecture/implementation-approach.md → .claude/skills-ja/implementation-approach/SKILL.md} +10 -5
- package/{docs/rules-ja/integration-e2e-testing.md → .claude/skills-ja/integration-e2e-testing/SKILL.md} +5 -8
- package/{docs/rules/project-context.md → .claude/skills-ja/project-context/SKILL.md} +7 -3
- package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +212 -0
- package/.claude/skills-ja/task-analyzer/SKILL.md +131 -0
- package/{docs/rules-ja/rules-index.yaml → .claude/skills-ja/task-analyzer/references/skills-index.yaml} +34 -19
- package/{docs/rules-ja/technical-spec.md → .claude/skills-ja/technical-spec/SKILL.md} +6 -6
- package/{docs/rules-ja/typescript.md → .claude/skills-ja/typescript-rules/SKILL.md} +16 -11
- package/{docs/rules-ja/typescript-testing.md → .claude/skills-ja/typescript-testing/SKILL.md} +11 -5
- package/CLAUDE.en.md +6 -6
- package/CLAUDE.ja.md +6 -6
- package/CLAUDE.md +19 -28
- package/README.ja.md +39 -10
- package/README.md +39 -10
- package/package.json +1 -1
- package/scripts/set-language.js +35 -53
- package/scripts/setup-project.js +4 -1
- package/docs/adr/template-ja.md +0 -64
- package/docs/design/template-ja.md +0 -285
- package/docs/guides/en/sub-agents.md +0 -343
- package/docs/guides/ja/sub-agents.md +0 -343
- package/docs/guides/sub-agents.md +0 -306
- package/docs/plans/20250123-integration-test-improvement.md +0 -993
- package/docs/rules/rules-index.yaml +0 -137
- package/docs/rules/technical-spec.md +0 -47
- package/docs/rules/typescript-testing.md +0 -188
- package/docs/rules-ja/frontend/typescript.md +0 -131
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: integration-e2e-testing
|
|
3
|
+
description: 統合・E2Eテスト設計原則、ROI計算、テストスケルトン仕様、レビュー基準。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 統合テスト・E2Eテスト設計・実装ルール
|
|
7
|
+
|
|
8
|
+
## テスト種別と上限
|
|
9
|
+
|
|
10
|
+
| 種別 | 目的 | ファイル形式 | 上限 |
|
|
11
|
+
|------|------|-------------|------|
|
|
12
|
+
| 統合テスト | コンポーネント間連携検証 | `*.int.test.ts` | 機能あたり3件 |
|
|
13
|
+
| E2Eテスト | クリティカルユーザージャーニー検証 | `*.e2e.test.ts` | 機能あたり1-2件 |
|
|
14
|
+
|
|
15
|
+
**クリティカルユーザージャーニー**: 収益影響・法的要件・大多数のユーザーが日常的に利用する機能
|
|
16
|
+
|
|
17
|
+
## 振る舞い優先の原則
|
|
18
|
+
|
|
19
|
+
### 観測可能性チェック(全てYESで対象)
|
|
20
|
+
|
|
21
|
+
| チェック | 質問 | NOの場合 |
|
|
22
|
+
|---------|------|----------|
|
|
23
|
+
| 観測可能 | ユーザーが結果を観測できるか? | 除外 |
|
|
24
|
+
| システム文脈 | 複数コンポーネントの統合が必要か? | 除外 |
|
|
25
|
+
| 自動化可能 | CI環境で安定実行できるか? | 除外 |
|
|
26
|
+
|
|
27
|
+
### Include/Exclude基準
|
|
28
|
+
|
|
29
|
+
**Include**: ビジネスロジック正確性、データ整合性、ユーザー可視機能、エラーハンドリング
|
|
30
|
+
**Exclude**: 外部実接続、パフォーマンス指標、実装詳細、UIレイアウト
|
|
31
|
+
|
|
32
|
+
## スケルトン仕様
|
|
33
|
+
|
|
34
|
+
### 必須コメント形式
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// AC: "[受入条件原文]"
|
|
38
|
+
// ROI: [0-100] | ビジネス価値: [0-10] | 頻度: [0-10]
|
|
39
|
+
// 振る舞い: [トリガー] → [処理] → [観測可能な結果]
|
|
40
|
+
// @category: core-functionality | integration | edge-case | ux | e2e
|
|
41
|
+
// @dependency: none | [コンポーネント名] | full-system
|
|
42
|
+
// @complexity: low | medium | high
|
|
43
|
+
it.todo('[AC番号]: [テスト名]')
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Property注釈
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Property: `[検証式]`
|
|
50
|
+
// fast-check: fc.property(fc.[arbitrary], (input) => [不変条件])
|
|
51
|
+
it.todo('[AC番号]-property: [不変条件記述]')
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### ROI計算
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
ROI = (ビジネス価値 × 頻度 + 法的要件 × 10 + 欠陥検出) / 総コスト
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
| 種別 | 総コスト | E2E生成条件 |
|
|
61
|
+
|------|---------|------------|
|
|
62
|
+
| 統合 | 11 | - |
|
|
63
|
+
| E2E | 38 | ROI > 50 |
|
|
64
|
+
|
|
65
|
+
## 実装ルール
|
|
66
|
+
|
|
67
|
+
### Property-Based Test実装
|
|
68
|
+
|
|
69
|
+
Property注釈がある場合、fast-checkライブラリ必須:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import fc from 'fast-check'
|
|
73
|
+
|
|
74
|
+
it('AC2-property: モデル名は常にgemini-3-pro-image-preview', () => {
|
|
75
|
+
fc.assert(
|
|
76
|
+
fc.property(fc.string(), (prompt) => {
|
|
77
|
+
const result = client.generate(prompt)
|
|
78
|
+
return result.model === 'gemini-3-pro-image-preview'
|
|
79
|
+
})
|
|
80
|
+
)
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**必須事項**:
|
|
85
|
+
- `fc.assert(fc.property(...))` 形式で記述
|
|
86
|
+
- スケルトンの`// fast-check:`コメントをそのまま実装に反映
|
|
87
|
+
- 失敗ケース発見時は具体的なユニットテストとして追加(リグレッション防止)
|
|
88
|
+
|
|
89
|
+
### 振る舞い検証の実装
|
|
90
|
+
|
|
91
|
+
**振る舞い記述の検証レベル**:
|
|
92
|
+
|
|
93
|
+
| ステップ種別 | 検証対象 | 例 |
|
|
94
|
+
|-------------|---------|-----|
|
|
95
|
+
| トリガー | Arrangeで再現 | API障害 → mockResolvedValue({ ok: false }) |
|
|
96
|
+
| 処理 | 中間状態または呼び出し | 関数呼び出し、状態変更 |
|
|
97
|
+
| 観測可能な結果 | 最終出力の値 | 戻り値、エラーメッセージ、ログ出力 |
|
|
98
|
+
|
|
99
|
+
**判定基準**: 「観測可能な結果」がテスト対象の**戻り値またはモックの呼び出し引数**として検証されていれば合格
|
|
100
|
+
|
|
101
|
+
### 検証項目の決定ルール
|
|
102
|
+
|
|
103
|
+
| スケルトンの状態 | 検証項目の決定方法 |
|
|
104
|
+
|-----------------|-------------------|
|
|
105
|
+
| `// 検証項目:` が列挙されている | 列挙された全項目をexpectで実装 |
|
|
106
|
+
| `// 検証項目:` がない | 「振る舞い」記述の「観測可能な結果」から導出 |
|
|
107
|
+
| 両方ある | 検証項目を優先、振る舞いは補足として使用 |
|
|
108
|
+
|
|
109
|
+
### 統合テストのモック境界
|
|
110
|
+
|
|
111
|
+
| 判断基準 | モック | 実物 |
|
|
112
|
+
|---------|--------|------|
|
|
113
|
+
| テスト対象の一部か? | No → モック可 | Yes → 実物必須 |
|
|
114
|
+
| 呼び出しがテストの検証対象か? | No → モック可 | Yes → 実物または検証可能なモック |
|
|
115
|
+
| 外部ネットワーク通信か? | Yes → モック必須 | No → 実物推奨 |
|
|
116
|
+
|
|
117
|
+
**判定フロー**:
|
|
118
|
+
1. 外部API(HTTP通信)→ モック必須
|
|
119
|
+
2. テスト対象のコンポーネント間連携 → 実物必須
|
|
120
|
+
3. ログ出力の検証が必要 → 検証可能なモック(vi.fn())を使用
|
|
121
|
+
4. ログ出力の検証が不要 → 実物または無視
|
|
122
|
+
|
|
123
|
+
### E2Eテストの実行条件
|
|
124
|
+
|
|
125
|
+
- 全コンポーネント実装完了後に実行
|
|
126
|
+
- モック禁止(`@dependency: full-system`)
|
|
127
|
+
|
|
128
|
+
## レビュー基準
|
|
129
|
+
|
|
130
|
+
### スケルトンと実装の整合性
|
|
131
|
+
|
|
132
|
+
| チェック | 不合格条件 |
|
|
133
|
+
|---------|-----------|
|
|
134
|
+
| Property検証 | Property注釈があるのにfast-check未使用 |
|
|
135
|
+
| 振る舞い検証 | 「観測可能な結果」に対応するexpectがない |
|
|
136
|
+
| 検証項目網羅 | 列挙された検証項目がexpectに含まれていない |
|
|
137
|
+
| モック境界 | 統合テストで内部コンポーネントをモック化 |
|
|
138
|
+
|
|
139
|
+
### 実装品質
|
|
140
|
+
|
|
141
|
+
| チェック | 不合格条件 |
|
|
142
|
+
|---------|-----------|
|
|
143
|
+
| AAA構造 | Arrange/Act/Assertの区切りが不明確 |
|
|
144
|
+
| 独立性 | テスト間で状態共有、実行順序依存 |
|
|
145
|
+
| 再現性 | 日時・乱数に依存し結果が変動 |
|
|
146
|
+
| 可読性 | テスト名と検証内容が一致しない |
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-context
|
|
3
|
+
description: プロジェクトの性質、技術スタック、実装原則を含むプロジェクト固有コンテキスト。各プロジェクトでカスタマイズ可能。
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# プロジェクトコンテキスト
|
|
2
7
|
|
|
3
8
|
## 基本設定
|
|
@@ -30,9 +35,8 @@
|
|
|
30
35
|
- 技術的制約事項
|
|
31
36
|
|
|
32
37
|
2. **アーキテクチャの選択**
|
|
33
|
-
-
|
|
34
|
-
- `docs/rules/architecture/` にプロジェクト固有の設計を配置
|
|
38
|
+
- アーキテクチャスキルから適切なパターンを選択
|
|
35
39
|
|
|
36
40
|
3. **環境設定**
|
|
37
41
|
- プロジェクトに適した環境変数管理方法の実装
|
|
38
|
-
- プロジェクト固有の設定ファイル追加
|
|
42
|
+
- プロジェクト固有の設定ファイル追加
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subagents-orchestration-guide
|
|
3
|
+
description: サブエージェント間の調整のためのオーケストレーションガイド。規模判定、ドキュメント要件、停止ポイント、自律実行モードを定義。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# サブエージェント実践ガイド - オーケストレーション指針
|
|
7
|
+
|
|
8
|
+
サブエージェントを活用してタスクを効率的に処理するための実践的な行動指針。
|
|
9
|
+
|
|
10
|
+
## 最重要原則:オーケストレーターとして振る舞う
|
|
11
|
+
|
|
12
|
+
**「私は作業者ではない。オーケストレーターである。」**
|
|
13
|
+
|
|
14
|
+
### 正しい振る舞い
|
|
15
|
+
- 新規タスク: requirement-analyzerから開始
|
|
16
|
+
- フロー実行中: 規模判定に基づくフローを厳守
|
|
17
|
+
- 各フェーズ: 適切なサブエージェントに委譲
|
|
18
|
+
- 停止ポイント: 必ずユーザー承認を待つ
|
|
19
|
+
|
|
20
|
+
### 避ける行為
|
|
21
|
+
- Grep/Glob/Readで自分で調査を始める
|
|
22
|
+
- 自分で分析や設計を考え始める
|
|
23
|
+
- 「まず調べてみます」と言って作業を開始する
|
|
24
|
+
- requirement-analyzerを後回しにする
|
|
25
|
+
|
|
26
|
+
**タスク開始時は必ずrequirement-analyzer。フロー開始後は規模判定に従う。**
|
|
27
|
+
|
|
28
|
+
## タスク受領時の判断
|
|
29
|
+
|
|
30
|
+
```mermaid
|
|
31
|
+
graph TD
|
|
32
|
+
Start[新規タスク受領] --> RA[requirement-analyzerで要件分析]
|
|
33
|
+
RA --> Scale[規模判定]
|
|
34
|
+
Scale --> Flow[規模に応じたフロー実行]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### フロー実行中の要件変更検知
|
|
38
|
+
|
|
39
|
+
**フロー実行中**にユーザーレスポンスで以下を検知したら、フローを停止してrequirement-analyzerへ:
|
|
40
|
+
- 新機能・動作の言及(追加の操作方法、別画面での表示など)
|
|
41
|
+
- 制約・条件の追加(データ量制限、権限制御など)
|
|
42
|
+
- 技術要件の変更(処理方式、出力形式の変更など)
|
|
43
|
+
|
|
44
|
+
**1つでも該当 → 統合要件でrequirement-analyzerから再開**
|
|
45
|
+
|
|
46
|
+
## 活用できるサブエージェント
|
|
47
|
+
|
|
48
|
+
### 実装支援エージェント
|
|
49
|
+
1. **quality-fixer**: 全体品質保証と修正完了まで自己完結処理
|
|
50
|
+
2. **task-decomposer**: 作業計画書の適切なタスク分解
|
|
51
|
+
3. **task-executor**: 個別タスクの実行と構造化レスポンス
|
|
52
|
+
4. **integration-test-reviewer**: 統合テスト/E2Eテストのスケルトン準拠レビュー
|
|
53
|
+
|
|
54
|
+
### ドキュメント作成エージェント
|
|
55
|
+
5. **requirement-analyzer**: 要件分析と作業規模判定(WebSearch対応、最新技術情報の調査)
|
|
56
|
+
6. **prd-creator**: Product Requirements Document作成(WebSearch対応、市場動向調査)
|
|
57
|
+
7. **technical-designer**: ADR/Design Doc作成(最新技術情報の調査、Property注釈付与)
|
|
58
|
+
8. **work-planner**: 作業計画書作成(テストスケルトンからメタ情報を抽出・反映)
|
|
59
|
+
9. **document-reviewer**: 単一ドキュメントの品質・完成度・ルール準拠チェック
|
|
60
|
+
10. **design-sync**: Design Doc間の整合性検証(明示的矛盾のみ検出)
|
|
61
|
+
11. **acceptance-test-generator**: Design DocのACから統合テストとE2Eテストのスケルトン生成
|
|
62
|
+
|
|
63
|
+
## オーケストレーション原則
|
|
64
|
+
|
|
65
|
+
### 責務分離を意識した振り分け
|
|
66
|
+
|
|
67
|
+
**task-executorの責務**:
|
|
68
|
+
- 実装作業とテスト追加
|
|
69
|
+
- 追加したテストのパス確認(既存テストは対象外)
|
|
70
|
+
- 品質保証はtask-executorの責務外
|
|
71
|
+
|
|
72
|
+
**quality-fixerの責務**:
|
|
73
|
+
- 全体品質保証(型チェック、lint、全テスト実行等)
|
|
74
|
+
- 品質エラーの完全修正実行
|
|
75
|
+
- 修正完了まで自己完結で処理
|
|
76
|
+
- 最終的な approved 判定(修正完了後のみ)
|
|
77
|
+
|
|
78
|
+
### 標準フロー
|
|
79
|
+
|
|
80
|
+
**基本サイクル**: `task-executor → エスカレーション判定・フォローアップ → quality-fixer → commit` の4ステップサイクルを管理。
|
|
81
|
+
各タスクごとにこのサイクルを繰り返し、品質を保証。
|
|
82
|
+
|
|
83
|
+
## Sub-agent間の制約
|
|
84
|
+
|
|
85
|
+
**重要**: Sub-agentから他のSub-agentを直接呼び出すことはできない。複数のSub-agentを連携させる場合は、メインAIがオーケストレーターとして動作。
|
|
86
|
+
|
|
87
|
+
## 規模判定とドキュメント要件
|
|
88
|
+
|
|
89
|
+
| 規模 | ファイル数 | PRD | ADR | Design Doc | 作業計画書 |
|
|
90
|
+
|------|-----------|-----|-----|------------|-----------|
|
|
91
|
+
| 小規模 | 1-2 | 更新※1 | 不要 | 不要 | 簡易版 |
|
|
92
|
+
| 中規模 | 3-5 | 更新※1 | 条件付き※2 | **必須** | **必須** |
|
|
93
|
+
| 大規模 | 6以上 | **必須**※3 | 条件付き※2 | **必須** | **必須** |
|
|
94
|
+
|
|
95
|
+
※1: 該当機能のPRDが存在する場合は更新
|
|
96
|
+
※2: アーキテクチャ変更、新技術導入、データフロー変更がある場合
|
|
97
|
+
※3: 新規作成/既存更新/リバースPRD(既存PRDがない場合)
|
|
98
|
+
|
|
99
|
+
## 構造化レスポンス仕様
|
|
100
|
+
|
|
101
|
+
各サブエージェントはJSON形式で応答:
|
|
102
|
+
- **task-executor**: status, filesModified, testsAdded, readyForQualityCheck
|
|
103
|
+
- **integration-test-reviewer**: status, verdict (approved/needs_revision), requiredFixes
|
|
104
|
+
- **quality-fixer**: status, checksPerformed, fixesApplied, approved
|
|
105
|
+
- **document-reviewer**: status, reviewsPerformed, issues, recommendations, approvalReady
|
|
106
|
+
- **design-sync**: sync_status, total_conflicts, conflicts (severity, type, source_file, target_file)
|
|
107
|
+
|
|
108
|
+
## 作業計画時の基本フロー
|
|
109
|
+
|
|
110
|
+
### 大規模(6ファイル以上)
|
|
111
|
+
1. requirement-analyzer → 要件分析 **[停止: 要件確認]**
|
|
112
|
+
2. prd-creator → PRD作成 → document-reviewer **[停止: 要件確認]**
|
|
113
|
+
3. technical-designer → ADR作成(必要な場合) → document-reviewer **[停止: 技術方針決定]**
|
|
114
|
+
4. technical-designer → Design Doc作成 → document-reviewer → design-sync **[停止: 設計内容確認]**
|
|
115
|
+
5. acceptance-test-generator → テストスケルトン生成
|
|
116
|
+
6. work-planner → 作業計画書作成 **[停止: 実装フェーズ全体の一括承認]**
|
|
117
|
+
7. **自律実行モード開始**: task-decomposer → 全タスク実行 → 完了報告
|
|
118
|
+
|
|
119
|
+
### 中規模(3-5ファイル)
|
|
120
|
+
1. requirement-analyzer → 要件分析 **[停止: 要件確認]**
|
|
121
|
+
2. technical-designer → Design Doc作成 → document-reviewer → design-sync **[停止: 技術方針決定]**
|
|
122
|
+
3. acceptance-test-generator → テストスケルトン生成
|
|
123
|
+
4. work-planner → 作業計画書作成 **[停止: 実装フェーズ全体の一括承認]**
|
|
124
|
+
5. **自律実行モード開始**: task-decomposer → 全タスク実行 → 完了報告
|
|
125
|
+
|
|
126
|
+
### 小規模(1-2ファイル)
|
|
127
|
+
1. 簡易計画書作成 **[停止: 実装フェーズ全体の一括承認]**
|
|
128
|
+
2. **自律実行モード開始**: 直接実装 → 完了報告
|
|
129
|
+
|
|
130
|
+
## 自律実行モード
|
|
131
|
+
|
|
132
|
+
### 権限委譲
|
|
133
|
+
|
|
134
|
+
**自律実行モード開始後**:
|
|
135
|
+
- 実装フェーズ全体の一括承認により、サブエージェントに権限委譲
|
|
136
|
+
- task-executor:実装権限(Edit/Write使用可)
|
|
137
|
+
- quality-fixer:修正権限(品質エラー自動修正)
|
|
138
|
+
|
|
139
|
+
### 自律実行の停止条件
|
|
140
|
+
|
|
141
|
+
以下の場合に自律実行を停止し、ユーザーにエスカレーション:
|
|
142
|
+
|
|
143
|
+
1. **サブエージェントからのエスカレーション**
|
|
144
|
+
- `status: "escalation_needed"` のレスポンス受信時
|
|
145
|
+
- `status: "blocked"` のレスポンス受信時
|
|
146
|
+
|
|
147
|
+
2. **要件変更検知時**
|
|
148
|
+
- 要件変更検知チェックリストで1つでも該当
|
|
149
|
+
- 自律実行を停止し、requirement-analyzerに統合要件で再分析
|
|
150
|
+
|
|
151
|
+
3. **work-planner更新制限に抵触時**
|
|
152
|
+
- task-decomposer開始後の要件変更は全体再設計が必要
|
|
153
|
+
- requirement-analyzerから全体フローを再開
|
|
154
|
+
|
|
155
|
+
4. **ユーザー明示停止時**
|
|
156
|
+
- 直接的な停止指示や割り込み
|
|
157
|
+
|
|
158
|
+
### 自律実行中のタスク管理
|
|
159
|
+
|
|
160
|
+
**2段階のTodoWrite管理**
|
|
161
|
+
|
|
162
|
+
#### Step1: task-decomposer完了後
|
|
163
|
+
フェーズ管理Todoを登録:
|
|
164
|
+
```
|
|
165
|
+
[in_progress] 実装フェーズ管理: Phase1開始
|
|
166
|
+
[pending] 実装フェーズ管理: Phase2開始
|
|
167
|
+
[pending] 実装フェーズ管理: Phase3開始
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Step2: フェーズ開始時
|
|
171
|
+
該当フェーズのタスクを4ステップで展開:
|
|
172
|
+
```
|
|
173
|
+
[completed] 実装フェーズ管理: Phase1開始
|
|
174
|
+
[pending] 実装フェーズ管理: Phase2開始
|
|
175
|
+
[in_progress] Phase1-Task01: task-executor実行
|
|
176
|
+
[pending] Phase1-Task01: エスカレーション判定・フォローアップ
|
|
177
|
+
[pending] Phase1-Task01: quality-fixer実行
|
|
178
|
+
[pending] Phase1-Task01: git commit
|
|
179
|
+
... (同パターンで繰り返し)
|
|
180
|
+
[pending] Phase1: 完了チェック
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## オーケストレーターの主な役割
|
|
184
|
+
|
|
185
|
+
1. **状態管理**: 現在のフェーズ、各サブエージェントの状態、次のアクションを把握
|
|
186
|
+
2. **情報の橋渡し**: サブエージェント間のデータ変換と伝達
|
|
187
|
+
3. **品質保証とコミット実行**: approved=true確認後、即座にgit commit実行
|
|
188
|
+
4. **自律実行モード管理**: 承認後の自律実行開始・停止・エスカレーション判断
|
|
189
|
+
5. **ADRステータス管理**: ユーザー判断後のADRステータス更新(Accepted/Rejected)
|
|
190
|
+
|
|
191
|
+
## 重要な制約
|
|
192
|
+
|
|
193
|
+
- **品質チェックは必須**: コミット前にquality-fixerの承認が必要
|
|
194
|
+
- **構造化レスポンス必須**: サブエージェント間の情報伝達はJSON形式
|
|
195
|
+
- **承認管理**: ドキュメント作成→document-reviewer実行→ユーザー承認を得てから次へ進む
|
|
196
|
+
- **フロー確認**: 承認取得後は必ず作業計画フロー(大規模/中規模/小規模)で次のステップを確認
|
|
197
|
+
- **整合性検証**: サブエージェント判定に矛盾がある場合はガイドラインを優先
|
|
198
|
+
|
|
199
|
+
## 人間との必須対話ポイント
|
|
200
|
+
|
|
201
|
+
### 基本原則
|
|
202
|
+
- **停止は必須**: 以下のタイミングでは必ず人間の応答を待つ
|
|
203
|
+
- **確認→合意のサイクル**: ドキュメント生成後は合意またはupdateモードでの修正指示を受けてから次へ進む
|
|
204
|
+
- **具体的な質問**: 選択肢(A/B/C)や比較表を用いて判断しやすく
|
|
205
|
+
- **効率より対話**: 手戻りを防ぐため、早い段階で確認を取る
|
|
206
|
+
|
|
207
|
+
### 主要な停止ポイント
|
|
208
|
+
- **requirement-analyzer完了後**: 要件分析結果と質問事項の確認
|
|
209
|
+
- **PRD作成→document-reviewer実行後**: 要件理解と整合性の確認
|
|
210
|
+
- **ADR作成→document-reviewer実行後**: 技術方針と整合性の確認
|
|
211
|
+
- **Design Doc作成→document-reviewer実行後**: 設計内容と整合性の確認
|
|
212
|
+
- **計画書作成後**: 実装フェーズ全体の一括承認
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-analyzer
|
|
3
|
+
description: メタ認知的タスク分析とスキル選択。タスクの本質を分析し、規模を見積もり、適切なスキルをメタデータと共に返却。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# タスクアナライザー - メタ認知的分析フレームワーク
|
|
7
|
+
|
|
8
|
+
## 目的
|
|
9
|
+
|
|
10
|
+
受け取ったタスクの本質を分析し、以下を決定:
|
|
11
|
+
1. 作業規模の判定(小規模/中規模/大規模)
|
|
12
|
+
2. 適用するスキルの特定
|
|
13
|
+
3. 潜在的な失敗パターンの認識
|
|
14
|
+
4. 初動アクションのガイダンス提供
|
|
15
|
+
|
|
16
|
+
## 分析フレームワーク
|
|
17
|
+
|
|
18
|
+
### タスク本質の抽出
|
|
19
|
+
|
|
20
|
+
タスクを受け取った際に分析:
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
taskEssence:
|
|
24
|
+
surfaceRequest: "[ユーザーが文字通り求めたこと]"
|
|
25
|
+
underlyingGoal: "[ユーザーが実際に達成したいこと]"
|
|
26
|
+
implicitRequirements: "[明示されていないが暗黙の要件]"
|
|
27
|
+
scaleDetermination:
|
|
28
|
+
fileCount: "[変更予定ファイル数]"
|
|
29
|
+
scale: "small|medium|large"
|
|
30
|
+
confidence: "high|medium|low"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 規模判定基準
|
|
34
|
+
|
|
35
|
+
| 規模 | ファイル数 | 特徴 |
|
|
36
|
+
|------|----------|-----|
|
|
37
|
+
| 小規模 | 1-2ファイル | 単一責務の変更、局所的な影響 |
|
|
38
|
+
| 中規模 | 3-5ファイル | コンポーネント横断の変更、調整が必要 |
|
|
39
|
+
| 大規模 | 6ファイル以上 | システム全体への影響、ドキュメントが必要 |
|
|
40
|
+
|
|
41
|
+
### スキル選択マトリクス
|
|
42
|
+
|
|
43
|
+
タスク特性に基づいて適用するスキルを選択:
|
|
44
|
+
|
|
45
|
+
| タスク種別 | 必要なスキル |
|
|
46
|
+
|-----------|------------|
|
|
47
|
+
| 新機能 | documentation-criteria, implementation-approach, typescript-rules, coding-standards |
|
|
48
|
+
| バグ修正 | coding-standards, typescript-rules, coding-standardsのデバッグ技法 |
|
|
49
|
+
| リファクタリング | coding-standards, implementation-approach |
|
|
50
|
+
| テスト作成 | typescript-testing, integration-e2e-testing |
|
|
51
|
+
| ドキュメント | documentation-criteria |
|
|
52
|
+
| フロントエンド | frontend/typescript-rules, frontend/typescript-testing, frontend/technical-spec |
|
|
53
|
+
|
|
54
|
+
### 失敗パターンの認識
|
|
55
|
+
|
|
56
|
+
開始前に潜在的な失敗パターンを特定:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
warningPatterns:
|
|
60
|
+
- pattern: "[検出されたパターン名]"
|
|
61
|
+
risk: "high|medium|low"
|
|
62
|
+
mitigation: "[このパターンを避ける方法]"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
監視すべき一般的なパターン:
|
|
66
|
+
1. **エラー修正連鎖** - 根本原因分析なしの表面的な修正
|
|
67
|
+
2. **型安全性の放棄** - any/asの過剰使用
|
|
68
|
+
3. **不十分なテスト** - Red-Green-Refactorのスキップ
|
|
69
|
+
4. **技術的不確実性** - スパイクなしでの未知技術の採用
|
|
70
|
+
5. **調査不足** - 既存コードを確認せずに開始
|
|
71
|
+
|
|
72
|
+
### 初動アクションガイダンス
|
|
73
|
+
|
|
74
|
+
分析に基づいて具体的な最初のステップを提供:
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
firstActionGuidance:
|
|
78
|
+
action: "[使用すべき具体的なツールまたはアクション]"
|
|
79
|
+
rationale: "[なぜこれが最初のステップであるべきか]"
|
|
80
|
+
expectedOutcome: "[このアクションで何が明らかになるか]"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 出力形式
|
|
84
|
+
|
|
85
|
+
タスクを分析する際、構造化されたJSONを返却:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"taskEssence": {
|
|
90
|
+
"surfaceRequest": "...",
|
|
91
|
+
"underlyingGoal": "...",
|
|
92
|
+
"implicitRequirements": ["..."],
|
|
93
|
+
"scaleDetermination": {
|
|
94
|
+
"fileCount": "...",
|
|
95
|
+
"scale": "...",
|
|
96
|
+
"confidence": "..."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"applicableSkills": [
|
|
100
|
+
{
|
|
101
|
+
"name": "...",
|
|
102
|
+
"relevance": "primary|secondary",
|
|
103
|
+
"sections": ["..."]
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"warningPatterns": [
|
|
107
|
+
{
|
|
108
|
+
"pattern": "...",
|
|
109
|
+
"risk": "...",
|
|
110
|
+
"mitigation": "..."
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"firstActionGuidance": {
|
|
114
|
+
"action": "...",
|
|
115
|
+
"rationale": "...",
|
|
116
|
+
"expectedOutcome": "..."
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## TodoWriteとの統合
|
|
122
|
+
|
|
123
|
+
task-analyzer完了後:
|
|
124
|
+
|
|
125
|
+
1. **TodoWriteを更新**: taskEssenceに基づいてタスク説明を精緻化
|
|
126
|
+
2. **スキル制約を追加**: 最初のtodoとして「スキル制約の確認」
|
|
127
|
+
3. **検証を追加**: 最終todoとして「スキル忠実度の検証」
|
|
128
|
+
4. **警告を反映**: 失敗パターンを避けるためタスク分解に反映
|
|
129
|
+
|
|
130
|
+
## 使用パターン
|
|
131
|
+
|
|
132
|
+
1. ユーザーから新規タスクを受け取る
|
|
133
|
+
2. task-analyzerを実行して本質を理解
|
|
134
|
+
3. 適用するスキルを読み込む
|
|
135
|
+
4. 精緻化した理解でTodoWriteを更新
|
|
136
|
+
5. スキルガイドラインに従って実装開始
|
|
137
|
+
6. 完了時にスキル忠実度を検証
|
|
138
|
+
|
|
139
|
+
## リファレンス
|
|
140
|
+
|
|
141
|
+
スキルのメタデータと選択:
|
|
142
|
+
- [スキルインデックス](references/skills-index.yaml) - 利用可能なすべてのスキルのメタデータ(タグ、典型的な使用法、主要な参照先を含む)
|