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.
Files changed (146) hide show
  1. package/.claude/agents/acceptance-test-generator.md +179 -245
  2. package/.claude/agents/code-reviewer.md +3 -9
  3. package/.claude/agents/design-sync.md +221 -0
  4. package/.claude/agents/document-reviewer.md +15 -10
  5. package/.claude/agents/integration-test-reviewer.md +192 -0
  6. package/.claude/agents/prd-creator.md +10 -6
  7. package/.claude/agents/quality-fixer-frontend.md +324 -0
  8. package/.claude/agents/quality-fixer.md +48 -62
  9. package/.claude/agents/requirement-analyzer.md +8 -8
  10. package/.claude/agents/rule-advisor.md +84 -103
  11. package/.claude/agents/task-decomposer.md +21 -27
  12. package/.claude/agents/task-executor-frontend.md +264 -0
  13. package/.claude/agents/task-executor.md +4 -16
  14. package/.claude/agents/technical-designer-frontend.md +444 -0
  15. package/.claude/agents/technical-designer.md +52 -27
  16. package/.claude/agents/work-planner.md +41 -14
  17. package/.claude/agents-en/acceptance-test-generator.md +13 -13
  18. package/.claude/agents-en/code-reviewer.md +8 -10
  19. package/.claude/agents-en/design-sync.md +6 -5
  20. package/.claude/agents-en/document-reviewer.md +8 -7
  21. package/.claude/agents-en/integration-test-reviewer.md +5 -4
  22. package/.claude/agents-en/prd-creator.md +7 -6
  23. package/.claude/agents-en/quality-fixer-frontend.md +3 -14
  24. package/.claude/agents-en/quality-fixer.md +9 -20
  25. package/.claude/agents-en/requirement-analyzer.md +8 -7
  26. package/.claude/agents-en/rule-advisor.md +57 -128
  27. package/.claude/agents-en/task-decomposer.md +4 -10
  28. package/.claude/agents-en/task-executor-frontend.md +4 -16
  29. package/.claude/agents-en/task-executor.md +5 -16
  30. package/.claude/agents-en/technical-designer-frontend.md +17 -15
  31. package/.claude/agents-en/technical-designer.md +13 -15
  32. package/.claude/agents-en/work-planner.md +9 -14
  33. package/.claude/agents-ja/acceptance-test-generator.md +9 -15
  34. package/.claude/agents-ja/code-reviewer.md +3 -11
  35. package/.claude/agents-ja/design-sync.md +2 -6
  36. package/.claude/agents-ja/document-reviewer.md +4 -9
  37. package/.claude/agents-ja/integration-test-reviewer.md +2 -5
  38. package/.claude/agents-ja/prd-creator.md +3 -7
  39. package/.claude/agents-ja/quality-fixer-frontend.md +2 -13
  40. package/.claude/agents-ja/quality-fixer.md +7 -18
  41. package/.claude/agents-ja/requirement-analyzer.md +5 -8
  42. package/.claude/agents-ja/rule-advisor.md +57 -128
  43. package/.claude/agents-ja/task-decomposer.md +4 -10
  44. package/.claude/agents-ja/task-executor-frontend.md +3 -15
  45. package/.claude/agents-ja/task-executor.md +3 -17
  46. package/.claude/agents-ja/technical-designer-frontend.md +17 -15
  47. package/.claude/agents-ja/technical-designer.md +13 -15
  48. package/.claude/agents-ja/work-planner.md +9 -14
  49. package/.claude/commands/build.md +7 -10
  50. package/.claude/commands/design.md +15 -5
  51. package/.claude/commands/front-build.md +103 -0
  52. package/.claude/commands/front-design.md +42 -0
  53. package/.claude/commands/front-plan.md +40 -0
  54. package/.claude/commands/implement.md +23 -29
  55. package/.claude/commands/plan.md +4 -4
  56. package/.claude/commands/project-inject.md +4 -4
  57. package/.claude/{commands-ja/refine-rule.md → commands/refine-skill.md} +25 -25
  58. package/.claude/{commands-ja/sync-rules.md → commands/sync-skills.md} +28 -28
  59. package/.claude/commands/task.md +1 -1
  60. package/.claude/commands-en/build.md +2 -2
  61. package/.claude/commands-en/design.md +1 -1
  62. package/.claude/commands-en/implement.md +8 -8
  63. package/.claude/commands-en/plan.md +3 -3
  64. package/.claude/commands-en/project-inject.md +4 -4
  65. package/.claude/commands-en/{refine-rule.md → refine-skill.md} +47 -48
  66. package/.claude/commands-en/{sync-rules.md → sync-skills.md} +29 -29
  67. package/.claude/commands-ja/build.md +2 -2
  68. package/.claude/commands-ja/design.md +1 -1
  69. package/.claude/commands-ja/implement.md +8 -8
  70. package/.claude/commands-ja/plan.md +3 -3
  71. package/.claude/commands-ja/project-inject.md +4 -4
  72. package/.claude/{commands/refine-rule.md → commands-ja/refine-skill.md} +25 -25
  73. package/.claude/{commands/sync-rules.md → commands-ja/sync-skills.md} +28 -28
  74. package/.claude/settings.local.json +21 -1
  75. package/{docs/rules/ai-development-guide.md → .claude/skills/coding-standards/SKILL.md} +94 -108
  76. package/{docs/rules/documentation-criteria.md → .claude/skills/documentation-criteria/SKILL.md} +19 -6
  77. package/.claude/skills/documentation-criteria/references/adr-template.md +64 -0
  78. package/.claude/skills/documentation-criteria/references/design-template.md +242 -0
  79. package/.claude/skills/documentation-criteria/references/plan-template.md +130 -0
  80. package/.claude/skills/documentation-criteria/references/prd-template.md +109 -0
  81. package/.claude/skills/frontend/technical-spec/SKILL.md +147 -0
  82. package/.claude/skills/frontend/typescript-rules/SKILL.md +315 -0
  83. package/.claude/skills/frontend/typescript-testing/SKILL.md +212 -0
  84. package/{docs/rules-ja/architecture/implementation-approach.md → .claude/skills/implementation-approach/SKILL.md} +10 -5
  85. package/.claude/skills/integration-e2e-testing/SKILL.md +146 -0
  86. package/{docs/rules-ja/project-context.md → .claude/skills/project-context/SKILL.md} +7 -3
  87. package/.claude/skills/subagents-orchestration-guide/SKILL.md +212 -0
  88. package/.claude/skills/task-analyzer/SKILL.md +142 -0
  89. package/.claude/skills/task-analyzer/references/skills-index.yaml +211 -0
  90. package/.claude/skills/technical-spec/SKILL.md +86 -0
  91. package/{docs/rules/typescript.md → .claude/skills/typescript-rules/SKILL.md} +22 -67
  92. package/.claude/skills/typescript-testing/SKILL.md +155 -0
  93. package/{docs/rules-en/coding-standards.md → .claude/skills-en/coding-standards/SKILL.md} +21 -108
  94. package/{docs/rules-en/documentation-criteria.md → .claude/skills-en/documentation-criteria/SKILL.md} +40 -42
  95. package/{docs/adr/template-en.md → .claude/skills-en/documentation-criteria/references/adr-template.md} +1 -1
  96. package/{docs/design/template-en.md → .claude/skills-en/documentation-criteria/references/design-template.md} +11 -31
  97. package/{docs/plans/template-en.md → .claude/skills-en/documentation-criteria/references/plan-template.md} +4 -4
  98. package/{docs/prd/template-en.md → .claude/skills-en/documentation-criteria/references/prd-template.md} +1 -1
  99. package/{docs/rules-en/frontend/technical-spec.md → .claude/skills-en/frontend/technical-spec/SKILL.md} +17 -13
  100. package/{docs/rules-en/frontend/typescript.md → .claude/skills-en/frontend/typescript-rules/SKILL.md} +17 -12
  101. package/{docs/rules-en/frontend/typescript-testing.md → .claude/skills-en/frontend/typescript-testing/SKILL.md} +11 -6
  102. package/{docs/rules-en/architecture/implementation-approach.md → .claude/skills-en/implementation-approach/SKILL.md} +7 -2
  103. package/{docs/rules-en/integration-e2e-testing.md → .claude/skills-en/integration-e2e-testing/SKILL.md} +15 -18
  104. package/{docs/rules-en/project-context.md → .claude/skills-en/project-context/SKILL.md} +7 -3
  105. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +224 -0
  106. package/.claude/skills-en/task-analyzer/SKILL.md +131 -0
  107. package/{docs/rules-en/rules-index.yaml → .claude/skills-en/task-analyzer/references/skills-index.yaml} +34 -20
  108. package/{docs/rules-en/technical-spec.md → .claude/skills-en/technical-spec/SKILL.md} +6 -6
  109. package/{docs/rules-en/typescript.md → .claude/skills-en/typescript-rules/SKILL.md} +15 -10
  110. package/{docs/rules-en/typescript-testing.md → .claude/skills-en/typescript-testing/SKILL.md} +10 -4
  111. package/{docs/rules-ja/coding-standards.md → .claude/skills-ja/coding-standards/SKILL.md} +12 -99
  112. package/{docs/rules-ja/documentation-criteria.md → .claude/skills-ja/documentation-criteria/SKILL.md} +18 -5
  113. package/.claude/skills-ja/documentation-criteria/references/adr-template.md +64 -0
  114. package/.claude/skills-ja/documentation-criteria/references/design-template.md +261 -0
  115. package/{docs/plans/template-ja.md → .claude/skills-ja/documentation-criteria/references/plan-template.md} +38 -38
  116. package/{docs/prd/template-ja.md → .claude/skills-ja/documentation-criteria/references/prd-template.md} +33 -33
  117. package/{docs/rules-ja/frontend/technical-spec.md → .claude/skills-ja/frontend/technical-spec/SKILL.md} +13 -9
  118. package/.claude/skills-ja/frontend/typescript-rules/SKILL.md +315 -0
  119. package/{docs/rules-ja/frontend/typescript-testing.md → .claude/skills-ja/frontend/typescript-testing/SKILL.md} +93 -5
  120. package/{docs/rules/architecture/implementation-approach.md → .claude/skills-ja/implementation-approach/SKILL.md} +10 -5
  121. package/{docs/rules-ja/integration-e2e-testing.md → .claude/skills-ja/integration-e2e-testing/SKILL.md} +5 -8
  122. package/{docs/rules/project-context.md → .claude/skills-ja/project-context/SKILL.md} +7 -3
  123. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +212 -0
  124. package/.claude/skills-ja/task-analyzer/SKILL.md +131 -0
  125. package/{docs/rules-ja/rules-index.yaml → .claude/skills-ja/task-analyzer/references/skills-index.yaml} +34 -19
  126. package/{docs/rules-ja/technical-spec.md → .claude/skills-ja/technical-spec/SKILL.md} +6 -6
  127. package/{docs/rules-ja/typescript.md → .claude/skills-ja/typescript-rules/SKILL.md} +16 -11
  128. package/{docs/rules-ja/typescript-testing.md → .claude/skills-ja/typescript-testing/SKILL.md} +11 -5
  129. package/CLAUDE.en.md +6 -6
  130. package/CLAUDE.ja.md +6 -6
  131. package/CLAUDE.md +19 -28
  132. package/README.ja.md +39 -10
  133. package/README.md +39 -10
  134. package/package.json +1 -1
  135. package/scripts/set-language.js +35 -53
  136. package/scripts/setup-project.js +4 -1
  137. package/docs/adr/template-ja.md +0 -64
  138. package/docs/design/template-ja.md +0 -285
  139. package/docs/guides/en/sub-agents.md +0 -343
  140. package/docs/guides/ja/sub-agents.md +0 -343
  141. package/docs/guides/sub-agents.md +0 -306
  142. package/docs/plans/20250123-integration-test-improvement.md +0 -993
  143. package/docs/rules/rules-index.yaml +0 -137
  144. package/docs/rules/technical-spec.md +0 -47
  145. package/docs/rules/typescript-testing.md +0 -188
  146. package/docs/rules-ja/frontend/typescript.md +0 -131
@@ -0,0 +1,242 @@
1
+ # [機能名] 設計書
2
+
3
+ ## 概要
4
+
5
+ [この機能の目的と概要を2-3文で説明]
6
+
7
+ ## 設計サマリー(メタ)
8
+
9
+ ```yaml
10
+ design_type: "新機能|拡張|リファクタリング"
11
+ risk_level: "低|中|高"
12
+ main_constraints:
13
+ - "[制約1]"
14
+ - "[制約2]"
15
+ biggest_risks:
16
+ - "[リスク1]"
17
+ - "[リスク2]"
18
+ unknowns:
19
+ - "[不確実性1]"
20
+ - "[不確実性2]"
21
+ ```
22
+
23
+ ## 背景と経緯
24
+
25
+ ### 前提となるADR
26
+
27
+ - [ADRファイル名]: [関連する決定事項]
28
+ - 共通技術ADRも該当する場合は参照
29
+
30
+ ### 合意事項チェックリスト
31
+
32
+ #### スコープ
33
+ - [ ] [変更対象の機能/コンポーネント]
34
+ - [ ] [追加する機能]
35
+
36
+ #### スコープ外(明示的に変更しないもの)
37
+ - [ ] [変更しない機能/コンポーネント]
38
+ - [ ] [維持する既存ロジック]
39
+
40
+ #### 制約
41
+ - [ ] 並行運用: [する/しない]
42
+ - [ ] 後方互換性: [必要/不要]
43
+ - [ ] パフォーマンス計測: [必要/不要]
44
+
45
+ ### 解決すべき課題
46
+
47
+ [この機能が解決しようとする具体的な問題や課題]
48
+
49
+ ### 現状の課題
50
+
51
+ [現在のシステムの問題点や制限事項]
52
+
53
+ ### 要件
54
+
55
+ #### 機能要件
56
+
57
+ - [必須の機能要件をリストアップ]
58
+
59
+ #### 非機能要件
60
+
61
+ - **パフォーマンス**: [レスポンス時間、スループットの要件]
62
+ - **スケーラビリティ**: [負荷増大時の対応要件]
63
+ - **信頼性**: [エラー率、可用性の要件]
64
+ - **保守性**: [コードの可読性、変更容易性]
65
+
66
+ ## 受入条件(AC)- EARS形式
67
+
68
+ 各ACはEARS形式で記述。キーワードがテストタイプを決定。
69
+
70
+ ### [機能要件1]
71
+
72
+ - [ ] **When** ユーザーが有効な認証情報でログインボタンをクリックすると、システムは認証を行いダッシュボードにリダイレクトする
73
+ - [ ] **If** 認証情報が無効な場合、**then** システムはエラーメッセージ「認証情報が無効です」を表示する
74
+ - [ ] **While** ユーザーがログインしている間、システムはセッションを60分間維持する
75
+
76
+ ### [機能要件2]
77
+
78
+ - [ ] システムはデータリストを1ページ10件のページネーション付きで表示する
79
+ - [ ] **When** 検索フィールドに入力すると、システムはリアルタイムでフィルタリングを適用する
80
+ - **Property**: `filtered.every(item => item.name.includes(query))`
81
+
82
+ ## 既存コードベース分析
83
+
84
+ ### 実装パスマッピング
85
+ | 種別 | パス | 説明 |
86
+ |-----|-----|-----|
87
+ | 既存 | src/[実際のパス] | [現在の実装] |
88
+ | 新規 | src/[計画パス] | [新規作成予定] |
89
+
90
+ ### 統合ポイント(新規実装でも記載)
91
+ - **統合先**: [何と連携するか]
92
+ - **呼び出し方式**: [どのように呼び出されるか]
93
+
94
+ ## 設計
95
+
96
+ ### 変更影響マップ
97
+
98
+ ```yaml
99
+ 変更対象: [変更するコンポーネント/機能]
100
+ 直接影響:
101
+ - [直接変更が必要なファイル/関数]
102
+ - [インターフェース変更箇所]
103
+ 間接影響:
104
+ - [データ形式の変更]
105
+ - [処理時間の変化]
106
+ 波及なし:
107
+ - [明示的に影響を受けない機能]
108
+ ```
109
+
110
+ ### アーキテクチャ概要
111
+
112
+ [この機能がシステム全体の中でどのように位置づけられるか]
113
+
114
+ ### データフロー
115
+
116
+ ```
117
+ [図やシュードコードでデータの流れを表現]
118
+ ```
119
+
120
+ ### 統合ポイント一覧
121
+
122
+ | 統合ポイント | 箇所 | 旧実装 | 新実装 | 切替方式 |
123
+ |------------|-----|-------|-------|---------|
124
+ | 統合ポイント1 | [クラス/関数] | [既存処理] | [新処理] | [DI/Factoryなど] |
125
+ | 統合ポイント2 | [別の箇所] | [既存] | [新規] | [方式] |
126
+
127
+ ### 主要コンポーネント
128
+
129
+ #### コンポーネント1
130
+
131
+ - **責務**: [このコンポーネントの責務範囲]
132
+ - **インターフェース**: [提供するAPIや型定義]
133
+ - **依存関係**: [他のコンポーネントとの関係]
134
+
135
+ ### 型定義
136
+
137
+ ```typescript
138
+ // 主要な型定義をここに記載
139
+ ```
140
+
141
+ ### データ契約
142
+
143
+ #### コンポーネント1
144
+
145
+ ```yaml
146
+ 入力:
147
+ 型: [TypeScript型定義]
148
+ 前提条件: [必須項目、形式の制約]
149
+ バリデーション: [検証方法]
150
+
151
+ 出力:
152
+ 型: [TypeScript型定義]
153
+ 保証: [常に満たされる条件]
154
+ エラー時: [例外/null/デフォルト値]
155
+
156
+ 不変条件:
157
+ - [処理前後で変わらない条件]
158
+ ```
159
+
160
+ ### エラーハンドリング
161
+
162
+ [エラーの種類とその処理方法]
163
+
164
+ ### ロギングとモニタリング
165
+
166
+ [ログに記録する内容とモニタリング方法]
167
+
168
+ ## 実装計画
169
+
170
+ ### 実装アプローチ
171
+
172
+ **選択したアプローチ**: [アプローチ名または組み合わせ]
173
+ **選択理由**: [プロジェクト制約と技術的依存関係を考慮した理由]
174
+
175
+ ### 技術的依存関係と実装順序
176
+
177
+ #### 必要な実装順序
178
+ 1. **[コンポーネント/機能A]**
179
+ - 技術的理由: [なぜ先に実装する必要があるか]
180
+ - 依存要素: [これに依存する他のコンポーネント]
181
+
182
+ 2. **[コンポーネント/機能B]**
183
+ - 技術的理由: [Aの後に実装する技術的必要性]
184
+ - 前提条件: [事前に必要な実装]
185
+
186
+ ### 統合ポイント
187
+ 各統合ポイントでE2E確認が必要:
188
+
189
+ **統合ポイント1: [名称]**
190
+ - コンポーネント: [コンポーネントA] -> [コンポーネントB]
191
+ - 確認方法: [統合が動作することの検証方法]
192
+
193
+ ### 移行戦略
194
+
195
+ [技術的な移行アプローチ、後方互換性の確保方法]
196
+
197
+ ## テスト戦略
198
+
199
+ ### 単体テスト
200
+
201
+ [単体テストの方針とカバレッジ目標]
202
+ - 機能受入条件の個別要素を検証
203
+
204
+ ### 統合テスト
205
+
206
+ [統合テストの方針と重要なテストケース]
207
+ - 機能受入条件の組み合わせ動作を検証
208
+
209
+ ### E2Eテスト
210
+
211
+ [E2Eテストの方針]
212
+ - 受入条件のシナリオ全体を検証
213
+ - ユーザー視点での機能動作を確認
214
+
215
+ ## セキュリティ考慮事項
216
+
217
+ [セキュリティ上の懸念点と対策]
218
+
219
+ ## 代替案
220
+
221
+ ### 代替案1
222
+
223
+ - **概要**: [代替案の説明]
224
+ - **メリット**: [利点]
225
+ - **デメリット**: [欠点]
226
+ - **不採用理由**: [採用しなかった理由]
227
+
228
+ ## リスクと対策
229
+
230
+ | リスク | 影響度 | 発生確率 | 対策 |
231
+ |-------|-------|---------|-----|
232
+ | [リスク1] | 高/中/低 | 高/中/低 | [対策] |
233
+
234
+ ## 参考資料
235
+
236
+ - [関連するドキュメントやリンク]
237
+
238
+ ## 更新履歴
239
+
240
+ | 日付 | バージョン | 変更内容 | 作成者 |
241
+ |-----|-----------|---------|-------|
242
+ | YYYY-MM-DD | 1.0 | 初版作成 | [名前] |
@@ -0,0 +1,130 @@
1
+ # 作業計画書: [タイトル]
2
+
3
+ 作成日: YYYY-MM-DD
4
+ 種別: feature|fix|refactor
5
+ 想定影響範囲: Xファイル
6
+ 関連Issue/PR: #XXX(該当する場合)
7
+
8
+ ## 関連ドキュメント
9
+ - 設計書: [docs/design/XXX.md]
10
+ - ADR: [docs/adr/ADR-XXXX.md](該当する場合)
11
+ - PRD: [docs/prd/XXX.md](該当する場合)
12
+
13
+ ## 目的
14
+ [なぜこの変更が必要か、何を解決するか]
15
+
16
+ ## 影響範囲
17
+ ### 対象ファイル
18
+ - [ ] src/domain/xxx
19
+ - [ ] src/application/xxx
20
+ - [ ] src/infrastructure/xxx
21
+ - [ ] src/presentation/xxx
22
+
23
+ ### テストファイル
24
+ - [ ] __tests__/xxx.test.ts
25
+ - [ ] __tests__/xxx.test.ts
26
+
27
+ ### ドキュメント
28
+ - [ ] ADR作成が必要(アーキテクチャ変更の場合)
29
+ - [ ] 設計書更新が必要
30
+ - [ ] README更新が必要
31
+
32
+ ## 実装計画
33
+
34
+ (注: フェーズ構成はDesign Docの技術的依存関係と実装アプローチに基づいて決定)
35
+
36
+ ### Phase 1: [フェーズ名](想定コミット数: X)
37
+ **目的**: [このフェーズで達成すること]
38
+
39
+ #### タスク
40
+ - [ ] タスク1: 具体的な作業内容
41
+ - [ ] タスク2: 具体的な作業内容
42
+ - [ ] 品質チェック: 段階的品質チェック実施(technical-specスキル参照)
43
+ - [ ] 単体テスト: 関連する全テストがパス
44
+
45
+ #### フェーズ完了条件
46
+ - [ ] [機能完了条件]
47
+ - [ ] [品質完了条件]
48
+
49
+ #### 動作確認手順
50
+ 1. [動作確認ステップ]
51
+ 2. [期待結果の確認]
52
+ 3. [パフォーマンス確認(該当する場合)]
53
+
54
+ ### Phase 2: [フェーズ名](想定コミット数: X)
55
+ **目的**: [このフェーズで達成すること]
56
+
57
+ #### タスク
58
+ - [ ] タスク1: 具体的な作業内容
59
+ - [ ] タスク2: 具体的な作業内容
60
+ - [ ] 品質チェック: 段階的品質チェック実施(technical-specスキル参照)
61
+ - [ ] 統合テスト: 機能全体の動作確認
62
+
63
+ #### フェーズ完了条件
64
+ - [ ] [機能完了条件]
65
+ - [ ] [品質完了条件]
66
+
67
+ #### 動作確認手順
68
+ 1. [動作確認ステップ]
69
+ 2. [期待結果の確認]
70
+ 3. [パフォーマンス確認(該当する場合)]
71
+
72
+ ### Phase 3: [フェーズ名](想定コミット数: X)
73
+ **目的**: [このフェーズで達成すること]
74
+
75
+ #### タスク
76
+ - [ ] タスク1: 具体的な作業内容
77
+ - [ ] タスク2: 具体的な作業内容
78
+ - [ ] 品質チェック: 段階的品質チェック実施(technical-specスキル参照)
79
+ - [ ] 統合テスト: コンポーネント連携の検証
80
+
81
+ #### フェーズ完了条件
82
+ - [ ] [機能完了条件]
83
+ - [ ] [品質完了条件]
84
+
85
+ #### 動作確認手順
86
+ [Design Docの該当する統合ポイントE2E確認をコピー]
87
+
88
+ ### 最終Phase: 品質保証(必須)(想定コミット数: 1)
89
+ **目的**: 全体品質保証とDesign Doc整合性検証
90
+
91
+ #### タスク
92
+ - [ ] Design Docの全受入条件達成を確認
93
+ - [ ] 品質チェック(型、lint、format)
94
+ - [ ] 全テスト実行
95
+ - [ ] カバレッジ70%以上
96
+ - [ ] ドキュメント更新
97
+
98
+ #### 動作確認手順
99
+ [Design DocからE2E確認手順をコピー]
100
+
101
+ ### 品質保証
102
+ - [ ] 段階的品質チェック実施(詳細: technical-specスキル参照)
103
+
104
+ ## リスクと対策
105
+ | リスク | 対策 |
106
+ |-------|-----|
107
+ | [想定されるリスク] | [対処方法] |
108
+
109
+ ## 完了条件
110
+ - [ ] 全フェーズ完了
111
+ - [ ] 各フェーズの動作確認手順を実施
112
+ - [ ] Design Docの受入条件を満たす
113
+ - [ ] 段階的品質チェック完了(エラー0件)
114
+ - [ ] 全テストパス
115
+ - [ ] 必要なドキュメント更新
116
+ - [ ] ユーザーレビュー承認取得
117
+
118
+ ## 進捗記録
119
+ ### Phase 1
120
+ - 開始: YYYY-MM-DD HH:MM
121
+ - 完了: YYYY-MM-DD HH:MM
122
+ - 備考: [特記事項]
123
+
124
+ ### Phase 2
125
+ - 開始: YYYY-MM-DD HH:MM
126
+ - 完了: YYYY-MM-DD HH:MM
127
+ - 備考: [特記事項]
128
+
129
+ ## 備考
130
+ [特記事項、参考情報、注意点など]
@@ -0,0 +1,109 @@
1
+ # PRD: [機能名]
2
+
3
+ ## 概要
4
+
5
+ ### 一言まとめ
6
+ [この機能を一言で説明]
7
+
8
+ ### 背景
9
+ [なぜこの機能が必要か?どのような問題を解決するか?]
10
+
11
+ ## ユーザーストーリー
12
+
13
+ ### 主要ユーザー
14
+ [主なターゲットユーザーを定義]
15
+
16
+ ### ユーザーストーリー
17
+ ```
18
+ [ユーザー種別]として
19
+ [目標/願望]をしたい
20
+ なぜなら[期待する価値/メリット]だから
21
+ ```
22
+
23
+ ### ユースケース
24
+ 1. [具体的な利用シナリオ1]
25
+ 2. [具体的な利用シナリオ2]
26
+ 3. [具体的な利用シナリオ3]
27
+
28
+ ## 機能要件
29
+
30
+ ### Must Have(MVP)
31
+ - [ ] 要件1: [詳細説明]
32
+ - AC: [受入条件 - Given/When/Then形式または測定可能な基準]
33
+ - [ ] 要件2: [詳細説明]
34
+ - AC: [受入条件]
35
+ - [ ] 要件3: [詳細説明]
36
+ - AC: [受入条件]
37
+
38
+ ### Nice to Have
39
+ - [ ] 要件1: [詳細説明]
40
+ - [ ] 要件2: [詳細説明]
41
+
42
+ ### スコープ外
43
+ - 項目1: [説明と理由]
44
+ - 項目2: [説明と理由]
45
+
46
+ ## 非機能要件
47
+
48
+ ### パフォーマンス
49
+ - レスポンス時間: [目標値]
50
+ - スループット: [目標値]
51
+ - 同時接続数: [目標値]
52
+
53
+ ### 信頼性
54
+ - 可用性: [目標値]
55
+ - エラー率: [目標値]
56
+
57
+ ### セキュリティ
58
+ - [セキュリティ要件の詳細]
59
+
60
+ ### スケーラビリティ
61
+ - [将来のスケーリングに関する考慮事項]
62
+
63
+ ## 成功基準
64
+
65
+ ### 定量的指標
66
+ 1. [測定可能な成功指標1]
67
+ 2. [測定可能な成功指標2]
68
+ 3. [測定可能な成功指標3]
69
+
70
+ ### 定性的指標
71
+ 1. [ユーザー体験の指標1]
72
+ 2. [ユーザー体験の指標2]
73
+
74
+ ## 技術的考慮事項
75
+
76
+ ### 依存関係
77
+ - [既存システムへの依存]
78
+ - [外部サービスへの依存]
79
+
80
+ ### 制約
81
+ - [技術的な制約]
82
+ - [リソースの制約]
83
+
84
+ ### 前提条件
85
+ - [確認が必要な前提1]
86
+ - [確認が必要な前提2]
87
+
88
+ ### リスクと対策
89
+ | リスク | 影響度 | 発生確率 | 対策 |
90
+ |-------|-------|---------|-----|
91
+ | [リスク1] | 高/中/低 | 高/中/低 | [対策] |
92
+ | [リスク2] | 高/中/低 | 高/中/低 | [対策] |
93
+
94
+ ## 未決定事項
95
+
96
+ - [ ] [質問1]: [選択肢や影響の説明]
97
+ - [ ] [質問2]: [選択肢や影響の説明]
98
+
99
+ *このセクションが空になるまでユーザーと議論し、確認後に削除*
100
+
101
+ ## 付録
102
+
103
+ ### 参考資料
104
+ - [関連ドキュメント1]
105
+ - [関連ドキュメント2]
106
+
107
+ ### 用語集
108
+ - **用語1**: [定義]
109
+ - **用語2**: [定義]
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: frontend/technical-spec
3
+ description: 環境変数管理、アーキテクチャ設計、ビルド・テストコマンドを含むフロントエンド技術設計ルール。
4
+ ---
5
+
6
+ # 技術設計ルール(フロントエンド)
7
+
8
+ ## 技術スタックの基本方針
9
+ TypeScriptベースのReactアプリケーション実装。アーキテクチャパターンはプロジェクトの要件と規模に応じて選択する。
10
+
11
+ ## 環境変数管理とセキュリティ
12
+
13
+ ### 環境変数管理
14
+ - **ビルドツールの環境変数システムを使用**: `process.env`はブラウザ環境で動作しない
15
+ - 設定レイヤーを通じて環境変数を一元管理
16
+ - TypeScriptによる適切な型安全性の実装
17
+ - デフォルト値設定と必須チェックの適切な実装
18
+
19
+ ```typescript
20
+ // ビルドツールの環境変数(公開値のみ)
21
+ const config = {
22
+ apiUrl: import.meta.env.API_URL || 'http://localhost:3000',
23
+ appName: import.meta.env.APP_NAME || 'My App'
24
+ }
25
+
26
+ // フロントエンドでは動作しない
27
+ const apiUrl = process.env.API_URL // NG
28
+ ```
29
+
30
+ ### セキュリティ(クライアントサイド制約)
31
+ - **重要**: すべてのフロントエンドコードは公開され、ブラウザで見える
32
+ - **クライアントサイドに秘密情報を保存しない**: APIキー、トークン、シークレットを環境変数に含めない
33
+ - `.env`ファイルをGitに含めない(バックエンドと同様)
34
+ - 機密情報のログ出力を禁止(パスワード、トークン、個人情報)
35
+ - エラーメッセージに機密情報を含めない
36
+
37
+ **秘密情報の正しい取り扱い**:
38
+ ```typescript
39
+ // セキュリティリスク: APIキーがブラウザで露出
40
+ const apiKey = import.meta.env.VITE_API_KEY
41
+ const response = await fetch(`https://api.example.com/data?key=${apiKey}`)
42
+
43
+ // 正しい: バックエンドが秘密情報を管理、フロントエンドはプロキシ経由でアクセス
44
+ const response = await fetch('/api/data') // バックエンドがAPIキー認証を処理
45
+ ```
46
+
47
+ ## アーキテクチャ設計
48
+
49
+ ### フロントエンドアーキテクチャパターン
50
+
51
+ **Reactコンポーネントアーキテクチャ**:
52
+ - **Function Components**: 必須、class componentsは非推奨
53
+ - **Custom Hooks**: ロジック再利用と依存性注入のため
54
+ - **コンポーネント階層**: Atoms → Molecules → Organisms → Templates → Pages
55
+ - **Props-driven**: コンポーネントは必要なすべてのデータをPropsで受け取る
56
+ - **Co-location**: テスト、スタイル、関連ファイルをコンポーネントと同じ場所に配置
57
+
58
+ **状態管理パターン**:
59
+ - **Local State**: コンポーネント固有の状態には`useState`
60
+ - **Context API**: コンポーネントツリー全体で状態を共有(テーマ、認証等)
61
+ - **Custom Hooks**: 状態ロジックと副作用をカプセル化
62
+ - **Server State**: APIデータのキャッシュにはReact QueryまたはSWR
63
+
64
+ ## データフロー統一原則
65
+
66
+ ### クライアントサイドのデータフロー
67
+ Reactアプリケーション全体で一貫したデータフローを維持:
68
+
69
+ - **Single Source of Truth**: 各状態には1つの権威あるソースがある
70
+ - UI状態: コンポーネントStateまたはContext
71
+ - サーバーデータ: React Query/SWRでキャッシュされたAPIレスポンス
72
+ - フォームデータ: React Hook Formを使ったControlled Components
73
+
74
+ - **単方向フロー**: データはPropsを通じて上から下へ流れる
75
+ ```
76
+ APIレスポンス → State → Props → Render → UI
77
+ ユーザー入力 → イベントハンドラ → State更新 → 再レンダリング
78
+ ```
79
+
80
+ - **Immutable Updates**: State更新には不変パターンを使用
81
+ ```typescript
82
+ // 不変なState更新
83
+ setUsers(prev => [...prev, newUser])
84
+
85
+ // 可変なState更新(禁止)
86
+ users.push(newUser)
87
+ setUsers(users)
88
+ ```
89
+
90
+ ### データフローにおける型安全性
91
+ - **Frontend → Backend**: Props/State(型保証済み) → APIリクエスト(シリアライゼーション)
92
+ - **Backend → Frontend**: APIレスポンス(`unknown`) → 型ガード → State(型保証済み)
93
+
94
+ ```typescript
95
+ // 型安全なデータフロー
96
+ async function fetchUser(id: string): Promise<User> {
97
+ const response = await fetch(`/api/users/${id}`)
98
+ const data: unknown = await response.json()
99
+
100
+ if (!isUser(data)) {
101
+ throw new Error('Invalid user data')
102
+ }
103
+
104
+ return data // User型として保証
105
+ }
106
+ ```
107
+
108
+ ## ビルドとテスト
109
+ package.jsonの`packageManager`フィールドに応じた実行コマンドを使用すること。
110
+
111
+ ### ビルドコマンド
112
+ - `dev` - 開発サーバー
113
+ - `build` - 本番ビルド
114
+ - `preview` - 本番ビルドのプレビュー
115
+ - `type-check` - 型チェック(出力なし)
116
+
117
+ ### テストコマンド
118
+ - `test` - テスト実行
119
+ - `test:coverage` - カバレッジ付きテスト実行
120
+ - `test:coverage:fresh` - カバレッジ付きテスト実行(キャッシュクリア)
121
+ - `test:safe` - 安全なテスト実行(自動クリーンアップ付き)
122
+ - `cleanup:processes` - Vitestプロセスのクリーンアップ
123
+
124
+ ### 品質チェック要件
125
+ 実装完了時に品質チェックは必須:
126
+
127
+ **Phase 1-3: 基本チェック**
128
+ - `check` - Biome(lint + format)
129
+ - `build` - TypeScriptビルド
130
+
131
+ **Phase 4-5: テストと最終確認**
132
+ - `test` - テスト実行
133
+ - `test:coverage:fresh` - カバレッジ測定
134
+ - `check:all` - 全体統合チェック
135
+
136
+ ### カバレッジ要件
137
+ - **必須**: 単体テストのカバレッジは60%以上
138
+ - **コンポーネント別目標**:
139
+ - Atoms: 70%以上
140
+ - Molecules: 65%以上
141
+ - Organisms: 60%以上
142
+ - Custom Hooks: 65%以上
143
+ - Utils: 70%以上
144
+
145
+ ### 非機能要件
146
+ - **ブラウザ互換性**: Chrome/Firefox/Safari/Edge(最新2バージョン)
147
+ - **レンダリング時間**: 主要ページで5秒以内