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
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: technical-spec
3
+ description: Technical design rules including environment variable management, architecture design, and build/testing commands.
4
+ ---
5
+
1
6
  # Technical Design Rules
2
7
 
3
8
  ## Basic Technology Stack Policy
@@ -21,13 +26,8 @@ TypeScript-based application implementation. Architecture patterns should be sel
21
26
  ### Architecture Design Principles
22
27
  Select appropriate architecture for each project and define clearly:
23
28
 
24
- - **Clear Definition**: Project architecture is defined in dedicated files under `docs/rules/architecture/`
25
29
  - **Separation of Responsibilities**: Clearly define responsibilities for each layer and module, and maintain boundaries
26
30
 
27
- ## Pattern Application Consistency
28
-
29
- Strictly follow selected architecture patterns. See `docs/rules/architecture/` for project-specific details.
30
-
31
31
  ## Unified Data Flow Principles
32
32
 
33
33
  #### Basic Principles
@@ -83,4 +83,4 @@ Quality checks are mandatory upon implementation completion:
83
83
 
84
84
  ### Coverage Requirements
85
85
  - **MANDATORY**: Unit test coverage MUST be 70% or higher
86
- - **Metrics**: Statements, Branches, Functions, Lines
86
+ - **Metrics**: Statements, Branches, Functions, Lines
@@ -1,9 +1,14 @@
1
+ ---
2
+ name: typescript-rules
3
+ description: TypeScript development rules for type safety and error handling. Use when implementing TypeScript code or reviewing type definitions.
4
+ ---
5
+
1
6
  # TypeScript Development Rules
2
7
 
3
8
  ## Type Safety in Backend Implementation
4
9
 
5
10
  **Type Safety in Data Flow**
6
- Input Layer (`unknown`) Type Guard Business Layer (Type Guaranteed) Output Layer (Serialization)
11
+ Input Layer (`unknown`) -> Type Guard -> Business Layer (Type Guaranteed) -> Output Layer (Serialization)
7
12
 
8
13
  **Backend-Specific Type Scenarios**:
9
14
  - **API Communication**: Always receive responses as `unknown`, validate with type guards
@@ -22,7 +27,7 @@ Input Layer (`unknown`) → Type Guard → Business Layer (Type Guaranteed) →
22
27
  - When state and business logic are tightly coupled (e.g., ShoppingCart, Session, StateMachine)
23
28
  - **Decision Criterion**: If "Does this data have behavior?" is Yes, consider using a class
24
29
  ```typescript
25
- // Functions and interfaces
30
+ // Functions and interfaces
26
31
  interface UserService { create(data: UserData): User }
27
32
  const userService: UserService = { create: (data) => {...} }
28
33
  ```
@@ -30,14 +35,14 @@ Input Layer (`unknown`) → Type Guard → Business Layer (Type Guaranteed) →
30
35
  **Function Design**
31
36
  - **0-2 parameters maximum**: Use object for 3+ parameters
32
37
  ```typescript
33
- // Object parameter
38
+ // Object parameter
34
39
  function createUser({ name, email, role }: CreateUserParams) {}
35
40
  ```
36
41
 
37
42
  **Dependency Injection**
38
43
  - **Inject external dependencies as parameters**: Ensure testability and modularity
39
44
  ```typescript
40
- // Receive dependency as parameter
45
+ // Receive dependency as parameter
41
46
  function createService(repository: Repository) { return {...} }
42
47
  ```
43
48
 
@@ -52,10 +57,10 @@ Input Layer (`unknown`) → Type Guard → Business Layer (Type Guaranteed) →
52
57
  - Imports use absolute paths (`src/`)
53
58
 
54
59
  **Clean Code Principles**
55
- - Delete unused code immediately
56
- - Delete debug `console.log()`
57
- - Commented-out code (manage history with version control)
58
- - Comments explain "why" (not "what")
60
+ - Delete unused code immediately
61
+ - Delete debug `console.log()`
62
+ - No commented-out code (manage history with version control)
63
+ - Comments explain "why" (not "what")
59
64
 
60
65
  ## Error Handling
61
66
 
@@ -63,12 +68,12 @@ Input Layer (`unknown`) → Type Guard → Business Layer (Type Guaranteed) →
63
68
 
64
69
  **Fail-Fast Principle**: Fail quickly on errors to prevent continued processing in invalid states
65
70
  ```typescript
66
- // Prohibited: Unconditional fallback
71
+ // Prohibited: Unconditional fallback
67
72
  catch (error) {
68
73
  return defaultValue // Hides error
69
74
  }
70
75
 
71
- // Required: Explicit failure
76
+ // Required: Explicit failure
72
77
  catch (error) {
73
78
  logger.error('Processing failed', error)
74
79
  throw error // Handle appropriately at higher layer
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: typescript-testing
3
+ description: TypeScript testing rules with Vitest. Includes coverage requirements, test design principles, and quality criteria.
4
+ ---
5
+
1
6
  # TypeScript Testing Rules
2
7
 
3
8
  ## Test Framework
@@ -32,7 +37,7 @@
32
37
  3. **Cross-functional Verification in E2E Tests**
33
38
  - Mandatory verification of impact on existing features when adding new features
34
39
  - Cover integration points with "High" and "Medium" impact levels from Design Doc's "Integration Point Map"
35
- - Verification pattern: Existing feature operation Enable new feature Verify continuity of existing features
40
+ - Verification pattern: Existing feature operation -> Enable new feature -> Verify continuity of existing features
36
41
  - Success criteria: No change in response content, processing time within 5 seconds
37
42
  - Designed for automatic execution in CI/CD pipelines
38
43
 
@@ -57,11 +62,11 @@ src/
57
62
 
58
63
  ### Test Code Quality Rules
59
64
 
60
- **Recommended: Keep all tests always active**
65
+ **Recommended: Keep all tests always active**
61
66
  - Merit: Guarantees test suite completeness
62
67
  - Practice: Fix problematic tests and activate them
63
68
 
64
- **Avoid: test.skip() or commenting out**
69
+ **Avoid: test.skip() or commenting out**
65
70
  - Reason: Creates test gaps and incomplete quality checks
66
71
  - Solution: Completely delete unnecessary tests
67
72
 
@@ -76,6 +81,7 @@ it('throws on negative price', () => expect(() => calc([{price: -1}])).toThrow()
76
81
 
77
82
  ### Literal Expected Values
78
83
  Use literal values for assertions. Do not replicate implementation logic.
84
+ **Valid test**: Expected value != Mock return value (implementation transforms/processes data)
79
85
  ```typescript
80
86
  expect(calcTax(100)).toBe(10) // not: 100 * TAX_RATE
81
87
  ```
@@ -119,7 +125,7 @@ it('reverses twice equals original', () => {
119
125
 
120
126
  ### Minimal Type Definition Requirements
121
127
  ```typescript
122
- // Only required parts
128
+ // Only required parts
123
129
  type TestRepo = Pick<Repository, 'find' | 'save'>
124
130
  const mock: TestRepo = { find: vi.fn(), save: vi.fn() }
125
131
 
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: coding-standards
3
+ description: 保守性、可読性、品質のための言語非依存コーディング原則。機能実装、リファクタリング、コードレビュー時に使用。
4
+ ---
5
+
1
6
  # 普遍的コーディング規約
2
7
 
3
8
  ## 技術的アンチパターン(赤信号パターン)
@@ -22,10 +27,11 @@
22
27
 
23
28
  ## 基本原則
24
29
 
25
- **積極的なリファクタリング** - 技術的負債を防ぎ、健全性を維持
26
- **使われない「念のため」のコード** - YAGNI原則(Kent Beck)に反する
30
+ - **積極的なリファクタリング** - 技術的負債を防ぎ、健全性を維持
31
+ - **使われない「念のため」のコード禁止** - YAGNI原則(Kent Beck)に反する
27
32
 
28
33
  ## コメント記述ルール
34
+
29
35
  - **機能説明重視**: コードが「何をするか」を記述
30
36
  - **履歴情報禁止**: 開発履歴は記載しない
31
37
  - **タイムレス**: いつ読んでも有効な内容のみ記述
@@ -62,16 +68,6 @@ Martin Fowler「Refactoring」に基づく重複コードの扱い方:
62
68
  - 共通化により可読性が著しく低下
63
69
  - テストコード内の簡単なヘルパー
64
70
 
65
- ### 実装例
66
- ```typescript
67
- // ❌ 1回目の重複で即共通化
68
- function validateUserEmail(email: string) { /* ... */ }
69
- function validateContactEmail(email: string) { /* ... */ }
70
-
71
- // ✅ 3回目で共通化
72
- function validateEmail(email: string, context: 'user' | 'contact' | 'admin') { /* ... */ }
73
- ```
74
-
75
71
  ## よくある失敗パターンと回避方法
76
72
 
77
73
  ### パターン1: エラー修正の連鎖
@@ -92,20 +88,14 @@ function validateEmail(email: string, context: 'user' | 'contact' | 'admin') { /
92
88
  ### パターン4: 技術的不確実性の無視
93
89
  **症状**: 新技術導入時の想定外エラー多発
94
90
  **原因**: 事前調査なしで「公式ドキュメント通りなら動くはず」
95
- **回避方法**:
91
+ **回避方法**:
96
92
  - タスクファイル冒頭に確実性評価を記載
97
- ```
98
- 確実性: low(理由: MCP接続の実例がない)
99
- 探索的実装: true
100
- フォールバック: 従来APIを使用
101
- ```
102
93
  - 確実性lowの場合、最初に最小限の動作確認コードを作成
103
- - 動作確認できたら本実装、できなければフォールバック実行
104
94
 
105
95
  ### パターン5: 既存コード調査不足
106
96
  **症状**: 重複実装、アーキテクチャ不整合、結合時の障害
107
97
  **原因**: 実装前の既存コード理解不足
108
- **回避方法**:
98
+ **回避方法**:
109
99
  - 実装前に類似機能の存在を必ず検索(同じドメイン、責務、設定パターンをキーワードに)
110
100
  - 類似機能を発見 → その実装を使用する(新規実装は行わない)
111
101
  - 類似機能が技術的負債 → ADRで改善提案を作成してから実装
@@ -134,16 +124,6 @@ Why5: 破壊的変更を含むメジャーバージョンアップ
134
124
  - モックで外部依存を置き換え
135
125
  - 問題が再現する最小構成を作成
136
126
 
137
- ### 4. デバッグログ出力
138
- ```typescript
139
- console.log('DEBUG:', {
140
- context: 'user-creation',
141
- input: { email, name },
142
- state: currentState,
143
- timestamp: new Date().toISOString()
144
- })
145
- ```
146
-
147
127
  ## 型安全性の基礎
148
128
 
149
129
  **型安全の原則**: `unknown`型と型ガードを使用する。`any`型は型チェックを無効化し、実行時エラーの原因となる。
@@ -161,12 +141,6 @@ function isUser(value: unknown): value is User {
161
141
  }
162
142
  ```
163
143
 
164
- **モダンな型機能の活用**
165
- - **satisfies演算子**: `const config = { port: 3000 } satisfies Config` - 型推論維持
166
- - **const assertion**: `const ROUTES = { HOME: '/' } as const satisfies Routes` - 不変かつ型安全
167
- - **ブランド型**: `type UserId = string & { __brand: 'UserId' }` - 意味を区別
168
- - **テンプレートリテラル型**: `type Endpoint = \`\${HttpMethod} \${Route}\`` - 文字列パターンを型で表現
169
-
170
144
  **型の複雑性管理**
171
145
  - フィールド数: 20個まで(超えたら責務で分割、外部API型は例外)
172
146
  - オプショナル率: 30%まで(超えたら必須/任意で分離)
@@ -185,29 +159,6 @@ function isUser(value: unknown): value is User {
185
159
 
186
160
  **優先順位**: 重複コード削除 > 長大な関数分割 > 複雑な条件分岐簡素化 > 型安全性向上
187
161
 
188
- ## 技術的判断が必要な場面
189
-
190
- ### 抽象化のタイミング
191
- - 具体的な実装を3回書いてからパターンを抽出
192
- - YAGNIを意識し、現在必要な機能のみ実装
193
- - 将来の拡張性より現在のシンプルさを優先
194
-
195
- ### パフォーマンス vs 可読性
196
- - 明確なボトルネックがない限り可読性を優先
197
- - 計測してから最適化(推測するな、計測せよ)
198
- - 最適化する場合はコメントで理由を明記
199
-
200
- ### 型定義の粒度
201
- - 過度に細かい型は保守性を低下させる
202
- - ドメインを適切に表現する型を設計
203
- - ユーティリティ型を活用して重複を削減
204
-
205
- ## 継続的改善のマインドセット
206
-
207
- - **謙虚**: 完璧なコードは存在しない、フィードバック歓迎
208
- - **勇気**: 必要なリファクタリングは大胆に実行
209
- - **透明性**: 技術的な判断理由を明確に記録
210
-
211
162
  ## 実装作業の完全性担保
212
163
 
213
164
  ### 影響範囲調査の必須手順
@@ -246,23 +197,10 @@ Grep -n "targetData\|SetData\|UpdateData" -o content
246
197
 
247
198
  対象: コード・ドキュメント・設定ファイル
248
199
 
249
- ### 既存コード削除判断フロー
250
-
251
- ```
252
- 使用中? No → 即削除(Git履歴に残る)
253
- Yes → 動作? No → 削除+再実装
254
- Yes → 修正
255
- ```
256
-
257
200
  ## Red-Green-Refactorプロセス(テストファースト開発)
258
201
 
259
202
  **推奨原則**: コード変更は必ずテストから始める
260
203
 
261
- **背景**:
262
- - 変更前の動作を保証し、リグレッションを防止
263
- - 期待する動作を明確化してから実装
264
- - リファクタリング時の安全性を確保
265
-
266
204
  **開発ステップ**:
267
205
  1. **Red**: 期待する動作のテストを書く(失敗する)
268
206
  2. **Green**: 最小限の実装でテストを通す
@@ -288,11 +226,11 @@ Grep -n "targetData\|SetData\|UpdateData" -o content
288
226
 
289
227
  ### モックとスタブの使用方針
290
228
 
291
- **推奨: 単体テストでの外部依存モック化**
229
+ **推奨: 単体テストでの外部依存モック化**
292
230
  - メリット: テストの独立性と再現性を確保
293
231
  - 実践: DB、API、ファイルシステム等の外部依存をモック化
294
232
 
295
- **避けるべき: 単体テストでの実際の外部接続**
233
+ **避けるべき: 単体テストでの実際の外部接続**
296
234
  - 理由: テスト速度が遅くなり、環境依存の問題が発生するため
297
235
 
298
236
  ### テスト失敗時の対応判断基準
@@ -301,33 +239,8 @@ Grep -n "targetData\|SetData\|UpdateData" -o content
301
239
  **実装を修正**: 妥当な仕様、ビジネスロジック、重要なエッジケース
302
240
  **判断に迷ったら**: ユーザーに確認
303
241
 
304
- ## テストヘルパーの活用ルール
305
-
306
- ### 基本原則
307
- テストヘルパーは、テストコードの重複を減らし、保守性を高めるために活用します。
308
-
309
- ### 判断基準
310
- | モックの特性 | 対応方針 |
311
- |-------------|---------|
312
- | **単純で安定** | 共通ヘルパーに集約 |
313
- | **複雑または変更頻度高** | 個別実装 |
314
- | **3箇所以上で重複** | 共通化を検討 |
315
- | **テスト固有ロジック** | 個別実装 |
316
-
317
242
  ## テストの粒度原則
318
243
 
319
244
  ### 原則:観測可能な振る舞いのみ
320
245
  **テスト対象**:公開API、戻り値、例外、外部呼び出し、永続化された状態
321
246
  **テスト対象外**:privateメソッド、内部状態、アルゴリズム詳細
322
-
323
- ```typescript
324
- // ✅ 振る舞いをテスト
325
- expect(calculatePrice(100, 0.1)).toBe(110)
326
-
327
- // ❌ 実装詳細をテスト
328
- expect((calculator as any).taxRate).toBe(0.1)
329
- ```
330
-
331
- ## 継続性テストの範囲
332
-
333
- 新機能追加時の既存機能への影響確認に限定。長時間運用・負荷テストはインフラ層の責務のため対象外。
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: documentation-criteria
3
+ description: PRD、ADR、Design Doc、作業計画書を含むドキュメント作成基準とテンプレート。
4
+ ---
5
+
1
6
  # ドキュメント作成基準
2
7
 
3
8
  ## 作成判定マトリクス
@@ -147,10 +152,10 @@
147
152
 
148
153
  | ドキュメント | パス | 命名規則 | テンプレート |
149
154
  |------------|-----|---------|------------|
150
- | PRD | `docs/prd/` | `[機能名]-prd.md` | `template-ja.md` |
151
- | ADR | `docs/adr/` | `ADR-[4桁]-[タイトル].md` | `template-ja.md` |
152
- | Design Doc | `docs/design/` | `[機能名]-design.md` | `template-ja.md` |
153
- | 作業計画書 | `docs/plans/` | `YYYYMMDD-{type}-{description}.md` | `template-ja.md` |
155
+ | PRD | `docs/prd/` | `[機能名]-prd.md` | `prd-template.md` |
156
+ | ADR | `docs/adr/` | `ADR-[4桁]-[タイトル].md` | `adr-template.md` |
157
+ | Design Doc | `docs/design/` | `[機能名]-design.md` | `design-template.md` |
158
+ | 作業計画書 | `docs/plans/` | `YYYYMMDD-{type}-{description}.md` | `plan-template.md` |
154
159
 
155
160
  ※作業計画書は`.gitignore`で除外
156
161
 
@@ -177,4 +182,12 @@
177
182
  1. **作成時**: 共通技術領域(ログ、エラーハンドリング、非同期処理等)を特定し、既存共通ADRを参照
178
183
  2. **不足時**: 必要な共通ADRが存在しない場合は作成を検討
179
184
  3. **Design Doc**: 「前提となるADR」セクションで共通ADRを明記
180
- 4. **準拠確認**: 設計が共通ADRの決定事項と整合しているかを検証
185
+ 4. **準拠確認**: 設計が共通ADRの決定事項と整合しているかを検証
186
+
187
+ ## テンプレート
188
+
189
+ テンプレートは`references/`ディレクトリにあります:
190
+ - [Design Documentテンプレート](references/design-template.md)
191
+ - [PRDテンプレート](references/prd-template.md)
192
+ - [作業計画書テンプレート](references/plan-template.md)
193
+ - [ADRテンプレート](references/adr-template.md)
@@ -0,0 +1,64 @@
1
+ # [ADR番号] [タイトル]
2
+
3
+ ## ステータス
4
+
5
+ [Proposed | Accepted | Deprecated | Superseded]
6
+
7
+ ## 経緯
8
+
9
+ [この決定が必要になった背景と理由を説明。問題の本質、現在の課題、制約を含む]
10
+
11
+ ## 決定事項
12
+
13
+ [実際に行った決定を説明。具体的で明確な記述を心がける]
14
+
15
+ ### 決定の詳細
16
+
17
+ | 項目 | 内容 |
18
+ |-----|-----|
19
+ | **決定** | [一文で決定内容] |
20
+ | **なぜ今か** | [今このタイミングで必要な理由] |
21
+ | **なぜこれか** | [代替案との比較理由(1-3行)] |
22
+ | **既知の不確実性** | [現時点で少なくとも1つの不確実性] |
23
+ | **撤回基準** | [この決定を見直すべきシグナル1つ] |
24
+
25
+ ## 根拠
26
+
27
+ [なぜこの決定を行ったか、代替案と比較して最善である理由を説明]
28
+
29
+ ### 検討した選択肢
30
+
31
+ 1. **選択肢1**: [説明]
32
+ - メリット: [利点をリストアップ]
33
+ - デメリット: [欠点をリストアップ]
34
+
35
+ 2. **選択肢2**: [説明]
36
+ - メリット: [利点をリストアップ]
37
+ - デメリット: [欠点をリストアップ]
38
+
39
+ 3. **選択肢3(採用)**: [説明]
40
+ - メリット: [利点をリストアップ]
41
+ - デメリット: [欠点をリストアップ]
42
+
43
+ ## 影響
44
+
45
+ ### ポジティブな影響
46
+
47
+ - [プロジェクトやシステムへの良い影響をリストアップ]
48
+
49
+ ### ネガティブな影響
50
+
51
+ - [受け入れる必要のある負の影響やトレードオフをリストアップ]
52
+
53
+ ### 中立的な影響
54
+
55
+ - [良くも悪くもない変化をリストアップ]
56
+
57
+ ## 実装指針
58
+
59
+ [原則的な方向性のみ。実装手順はDesign Docへ]
60
+ 例: 「依存性注入を使用」✓、「Phase 1で実装」✗
61
+
62
+ ## 関連情報
63
+
64
+ - [関連するADR、ドキュメント、Issue、PRなどへのリンク]