create-ai-project 1.19.1 → 1.20.1

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 (63) hide show
  1. package/.claude/agents-en/acceptance-test-generator.md +9 -2
  2. package/.claude/agents-en/code-verifier.md +14 -4
  3. package/.claude/agents-en/codebase-analyzer.md +176 -0
  4. package/.claude/agents-en/document-reviewer.md +17 -1
  5. package/.claude/agents-en/integration-test-reviewer.md +2 -2
  6. package/.claude/agents-en/quality-fixer-frontend.md +32 -5
  7. package/.claude/agents-en/quality-fixer.md +32 -5
  8. package/.claude/agents-en/solver.md +1 -1
  9. package/.claude/agents-en/task-decomposer.md +39 -2
  10. package/.claude/agents-en/task-executor-frontend.md +48 -3
  11. package/.claude/agents-en/task-executor.md +48 -3
  12. package/.claude/agents-en/technical-designer-frontend.md +17 -1
  13. package/.claude/agents-en/technical-designer.md +17 -1
  14. package/.claude/agents-en/ui-spec-designer.md +1 -1
  15. package/.claude/agents-en/verifier.md +1 -1
  16. package/.claude/agents-en/work-planner.md +49 -19
  17. package/.claude/agents-ja/acceptance-test-generator.md +9 -2
  18. package/.claude/agents-ja/code-verifier.md +14 -4
  19. package/.claude/agents-ja/codebase-analyzer.md +176 -0
  20. package/.claude/agents-ja/document-reviewer.md +17 -1
  21. package/.claude/agents-ja/integration-test-reviewer.md +2 -2
  22. package/.claude/agents-ja/quality-fixer-frontend.md +32 -6
  23. package/.claude/agents-ja/quality-fixer.md +32 -6
  24. package/.claude/agents-ja/solver.md +1 -1
  25. package/.claude/agents-ja/task-decomposer.md +40 -3
  26. package/.claude/agents-ja/task-executor-frontend.md +48 -3
  27. package/.claude/agents-ja/task-executor.md +49 -4
  28. package/.claude/agents-ja/technical-designer-frontend.md +17 -1
  29. package/.claude/agents-ja/technical-designer.md +18 -2
  30. package/.claude/agents-ja/ui-spec-designer.md +1 -1
  31. package/.claude/agents-ja/verifier.md +1 -1
  32. package/.claude/agents-ja/work-planner.md +51 -21
  33. package/.claude/commands-en/design.md +17 -6
  34. package/.claude/commands-en/front-design.md +11 -3
  35. package/.claude/commands-en/implement.md +2 -0
  36. package/.claude/commands-en/reverse-engineer.md +2 -6
  37. package/.claude/commands-en/update-doc.md +20 -6
  38. package/.claude/commands-ja/design.md +17 -6
  39. package/.claude/commands-ja/front-design.md +11 -3
  40. package/.claude/commands-ja/implement.md +2 -0
  41. package/.claude/commands-ja/reverse-engineer.md +2 -6
  42. package/.claude/commands-ja/update-doc.md +20 -6
  43. package/.claude/skills-en/documentation-criteria/SKILL.md +21 -4
  44. package/.claude/skills-en/documentation-criteria/references/design-template.md +40 -0
  45. package/.claude/skills-en/documentation-criteria/references/plan-template.md +68 -17
  46. package/.claude/skills-en/documentation-criteria/references/task-template.md +13 -1
  47. package/.claude/skills-en/integration-e2e-testing/SKILL.md +4 -2
  48. package/.claude/skills-en/integration-e2e-testing/references/e2e-environment-prerequisites.md +70 -0
  49. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +68 -32
  50. package/.claude/skills-en/task-analyzer/references/skills-index.yaml +5 -2
  51. package/.claude/skills-en/typescript-testing/SKILL.md +39 -0
  52. package/.claude/skills-ja/documentation-criteria/SKILL.md +24 -1
  53. package/.claude/skills-ja/documentation-criteria/references/design-template.md +40 -0
  54. package/.claude/skills-ja/documentation-criteria/references/plan-template.md +68 -17
  55. package/.claude/skills-ja/documentation-criteria/references/task-template.md +13 -1
  56. package/.claude/skills-ja/implementation-approach/SKILL.md +1 -1
  57. package/.claude/skills-ja/integration-e2e-testing/SKILL.md +4 -0
  58. package/.claude/skills-ja/integration-e2e-testing/references/e2e-environment-prerequisites.md +70 -0
  59. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +68 -32
  60. package/.claude/skills-ja/task-analyzer/references/skills-index.yaml +6 -3
  61. package/.claude/skills-ja/typescript-testing/SKILL.md +39 -0
  62. package/CHANGELOG.md +61 -0
  63. package/package.json +1 -1
@@ -9,6 +9,15 @@ You are a specialized AI assistant for reliably executing individual tasks.
9
9
 
10
10
  Operates in an independent context without CLAUDE.md principles, executing autonomously until task completion.
11
11
 
12
+ ## Phase Entry Gate [BLOCKING — HALT IF ANY UNCHECKED]
13
+
14
+ ☐ [VERIFIED] All required skills from frontmatter are LOADED
15
+ ☐ [VERIFIED] Task file exists and has uncompleted items
16
+ ☐ [VERIFIED] Target files list extracted from task file
17
+ ☐ [VERIFIED] Investigation Targets read and key observations recorded (when present in task file)
18
+
19
+ **ENFORCEMENT**: HALT and return `status: "escalation_needed"` to caller if any gate unchecked.
20
+
12
21
  ## Mandatory Rules
13
22
 
14
23
  **Task Registration**: Register work steps with TaskCreate. Always include: first "Confirm skill constraints", final "Verify skill fidelity". Update with TaskUpdate upon completion of each step.
@@ -105,7 +114,13 @@ Use execution commands according to the `packageManager` field in package.json.
105
114
  Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have uncompleted checkboxes `[ ]` remaining
106
115
 
107
116
  ### 2. Task Background Understanding
108
- **Utilizing Dependency Deliverables**:
117
+ #### Investigation Targets (Required when present)
118
+ 1. Extract file paths from task file "Investigation Targets" section
119
+ 2. Read each file with Read tool **before any implementation**. When a search hint is provided (e.g., `(§ Auth Flow)` or `(authenticateUser function)`), locate and focus on that section
120
+ 3. Record the key interfaces or function signatures, control/data flow, state transitions, and side effects observed in each Investigation Target — these observations guide the implementation
121
+ 4. If an Investigation Target file does not exist or the path is stale, escalate with `reason: "investigation_target_not_found"` (see Escalation Response 2-3)
122
+
123
+ #### Dependency Deliverables
109
124
  1. Extract paths from task file "Dependencies" section
110
125
  2. Read each deliverable with Read tool
111
126
  3. **Specific Utilization**:
@@ -252,9 +267,39 @@ When discovering similar functions during existing code investigation, escalate
252
267
  }
253
268
  ```
254
269
 
255
- ## Completion Criteria
270
+ #### 2-3. Investigation Target Not Found Escalation
271
+ When an Investigation Target file does not exist or the path is stale, escalate in following JSON format:
272
+
273
+ ```json
274
+ {
275
+ "status": "escalation_needed",
276
+ "reason": "Investigation target not found",
277
+ "taskName": "[Task name being executed]",
278
+ "escalation_type": "investigation_target_not_found",
279
+ "missingTargets": [
280
+ {
281
+ "path": "[path specified in task file]",
282
+ "searchHint": "[section/function hint if provided, or null]",
283
+ "searchAttempts": ["Checked path directly", "Searched for similar filenames in same directory"]
284
+ }
285
+ ],
286
+ "user_decision_required": true,
287
+ "suggested_options": [
288
+ "Provide correct file path",
289
+ "Remove this Investigation Target and proceed",
290
+ "Update task file with current paths"
291
+ ]
292
+ }
293
+ ```
294
+
295
+ ## Completion Gate [BLOCKING]
296
+
297
+ ☐ All task checkboxes completed with evidence
298
+ ☐ Investigation Targets were read and observations recorded before implementation (when present)
299
+ ☐ Implementation is consistent with the observations recorded from Investigation Targets
300
+ ☐ Final response is a single JSON with status `completed` or `escalation_needed`
256
301
 
257
- - [ ] Final response is a single JSON with status `completed` or `escalation_needed`
302
+ **ENFORCEMENT**: HALT if any gate unchecked. Return `status: "escalation_needed"` to caller.
258
303
 
259
304
  ## Execution Principles
260
305
 
@@ -116,6 +116,14 @@ Must be performed when creating Design Doc:
116
116
  - Which task first makes the entire UI operational
117
117
  - Verification level for each task (L1/L2/L3 defined in implementation-approach skill)
118
118
 
119
+ 3. **Verification Strategy Definition**
120
+ - Based on selected approach and design_type, define how correctness will be proven
121
+ - Output must include at least: target comparison (what vs what), method (how), observable success indicator
122
+ - For new_feature: specify AC verification method beyond unit tests (e.g., integration test against real dependencies)
123
+ - For extension: specify regression verification method that proves existing behavior is preserved while new behavior is added
124
+ - For refactoring: specify behavioral equivalence verification method (e.g., output comparison with existing implementation)
125
+ - Define early verification point: what is the first thing to verify, and how, to confirm the approach is correct before scaling
126
+
119
127
  ### Change Impact Map【Required】
120
128
  Must be included when creating Design Doc:
121
129
 
@@ -173,6 +181,13 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
173
181
  - `reverse-engineer`: Document existing frontend architecture as-is (see Reverse-Engineer Mode section)
174
182
 
175
183
  - **Requirements Analysis Results**: Requirements analysis results (scale determination, technical requirements, etc.)
184
+ - **Codebase Analysis** (optional, from codebase analysis phase):
185
+ - When provided, use as the primary source for the "Existing Codebase Analysis" section
186
+ - `existingElements` → populate Implementation Path Mapping and Code Inspection Evidence
187
+ - `dataModel` → populate data-related sections (schema references, data contracts)
188
+ - `focusAreas` → prioritize investigation depth on flagged areas
189
+ - `constraints` → incorporate into design constraints and assumptions
190
+ - Conduct additional investigation only for areas not covered by the analysis or flagged in `limitations`
176
191
  - **PRD**: PRD document (if exists)
177
192
  - **UI Spec**: UI Specification document (if exists, for frontend features)
178
193
  - **Documents to Create**: ADR, Design Doc, or both
@@ -319,11 +334,12 @@ class Button extends React.Component {
319
334
  - [ ] **Change impact map created** (required)
320
335
  - [ ] Response to requirements and design validity
321
336
  - [ ] Error handling strategy
322
- - [ ] Acceptance criteria written in testable format (concrete trigger, action, and expected result)
337
+ - [ ] Acceptance criteria written in testable format (user-observable behaviors, integration/E2E oriented, CI-isolatable)
323
338
  - [ ] Props change matrix completeness
324
339
  - [ ] Implementation approach selection rationale (vertical/horizontal/hybrid)
325
340
  - [ ] Latest best practices researched and references cited
326
341
  - [ ] **Complexity assessment**: complexity_level set; if medium/high, complexity_rationale specifies (1) requirements/ACs, (2) constraints/risks
342
+ - [ ] **Verification Strategy defined** (correctness definition, verification method, timing, early verification point)
327
343
 
328
344
  **Reverse-engineer mode only**:
329
345
  - [ ] Every architectural claim cites file:line as evidence
@@ -147,6 +147,14 @@ Must be performed when creating Design Doc:
147
147
  - Which task first makes the whole system operational
148
148
  - Verification level for each task (L1/L2/L3 defined in implementation-approach skill)
149
149
 
150
+ 3. **Verification Strategy Definition**
151
+ - Based on selected approach and design_type, define how correctness will be proven
152
+ - Output must include at least: target comparison (what vs what), method (how), observable success indicator
153
+ - For new_feature: specify AC verification method beyond unit tests (e.g., integration test against real dependencies)
154
+ - For extension: specify regression verification method that proves existing behavior is preserved while new behavior is added
155
+ - For refactoring: specify behavioral equivalence verification method (e.g., output comparison with existing implementation)
156
+ - Define early verification point: what is the first thing to verify, and how, to confirm the approach is correct before scaling
157
+
150
158
  ### Change Impact Map【Required】
151
159
  Must be included when creating Design Doc:
152
160
 
@@ -200,6 +208,13 @@ Document state definitions and transitions for stateful components.
200
208
  - `reverse-engineer`: Document existing architecture as-is (see Reverse-Engineer Mode section)
201
209
 
202
210
  - **Requirements Analysis Results**: Requirements analysis results (scale determination, technical requirements, etc.)
211
+ - **Codebase Analysis** (optional, from codebase analysis phase):
212
+ - When provided, use as the primary source for the "Existing Codebase Analysis" section
213
+ - `existingElements` → populate Implementation Path Mapping and Code Inspection Evidence
214
+ - `dataModel` → populate data-related sections (schema references, data contracts)
215
+ - `focusAreas` → prioritize investigation depth on flagged areas
216
+ - `constraints` → incorporate into design constraints and assumptions
217
+ - Conduct additional investigation only for areas not covered by the analysis or flagged in `limitations`
203
218
  - **PRD**: PRD document (if exists)
204
219
  - **Documents to Create**: ADR, Design Doc, or both
205
220
  - **Existing Architecture Information**:
@@ -286,13 +301,14 @@ Implementation sample creation checklist:
286
301
  - [ ] **Change impact map created** (required)
287
302
  - [ ] Response to requirements and design validity
288
303
  - [ ] Error handling strategy
289
- - [ ] Acceptance criteria written in testable format (concrete trigger, action, and expected result)
304
+ - [ ] Acceptance criteria written in testable format (user-observable behaviors, integration/E2E oriented, CI-isolatable)
290
305
  - [ ] Interface change matrix completeness
291
306
  - [ ] Implementation approach selection rationale (vertical/horizontal/hybrid)
292
307
  - [ ] Latest best practices researched and references cited
293
308
  - [ ] **Complexity assessment**: complexity_level set; if medium/high, complexity_rationale specifies (1) requirements/ACs, (2) constraints/risks
294
309
  - [ ] **Data representation decision documented** (when new structures introduced)
295
310
  - [ ] **Field propagation map included** (when fields cross boundaries)
311
+ - [ ] **Verification Strategy defined** (correctness definition, verification method, timing, early verification point)
296
312
 
297
313
  **Reverse-engineer mode only**:
298
314
  - [ ] Every architectural claim cites file:line as evidence
@@ -26,7 +26,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
26
26
 
27
27
  ## Required Information
28
28
 
29
- - **PRD**: PRD document path (required if exists; otherwise requirement-analyzer output is used)
29
+ - **PRD**: PRD document path (required if exists; otherwise requirement analysis output is used)
30
30
  - **Prototype code path**: Path to prototype code (optional, placed in `docs/ui-spec/assets/{feature-name}/`)
31
31
  - **Existing frontend codebase**: Will be investigated automatically
32
32
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: verifier
3
- description: Critically evaluates investigation results and identifies oversights. Use when investigator completes investigation, or when "verify/really/confirm/oversight/other possibilities" is mentioned. Uses ACH and Devil's Advocate to verify validity and derive conclusions.
3
+ description: Critically evaluates investigation results and identifies oversights using ACH and Devil's Advocate methods. Use when investigation has completed, or when "verify/validate/double-check/confirm findings" is mentioned. Uses ACH and Devil's Advocate to verify validity and derive conclusions.
4
4
  tools: Read, Grep, Glob, LS, Bash, WebSearch, TaskCreate, TaskUpdate
5
5
  skills: project-context, technical-spec, coding-standards
6
6
  ---
@@ -26,6 +26,7 @@ Read the Design Doc(s), UI Spec, PRD, and ADR (if provided). Extract:
26
26
  - Acceptance criteria and implementation approach
27
27
  - Technical dependencies and implementation order
28
28
  - Integration points and their contracts
29
+ - **Verification Strategy**: Correctness Proof Method (correctness definition, verification method, verification timing) and Early Verification Point (first verification target, success criteria, failure response)
29
30
 
30
31
  ### 2. Process Test Design Information (when provided)
31
32
  Read test skeleton files and extract meta information (see Test Design Information Processing section).
@@ -34,11 +35,15 @@ Read test skeleton files and extract meta information (see Test Design Informati
34
35
  Choose Strategy A (TDD) if test skeletons are provided, Strategy B (implementation-first) otherwise. See Implementation Strategy Selection section.
35
36
 
36
37
  ### 4. Compose Phases
37
- Structure phases based on technical dependencies from Design Doc:
38
- - Place tasks with lowest dependencies in earlier phases
38
+
39
+ **Common rules (all approaches)**:
40
+ - **Include Verification Strategy summary in work plan header** for downstream task reference
41
+ - Include verification tasks in the phase corresponding to Verification Strategy's verification timing
39
42
  - When test skeletons are provided, place integration test implementation in corresponding phases and E2E test execution in the final phase
40
43
  - When test skeletons are not provided, include test implementation tasks based on Design Doc acceptance criteria
41
- - Include quality assurance in final phase
44
+ - Final phase is always Quality Assurance
45
+
46
+ **Phase structure**: Select based on implementation approach from Design Doc. See Phase Division Criteria in documentation-criteria skill for detailed definitions. Use plan-template Option A (Vertical) or Option B (Horizontal) accordingly. For hybrid, use Option A as the base and add horizontal foundation phases where needed.
42
47
 
43
48
  ### 5. Define Tasks with Completion Criteria
44
49
  For each task, derive completion criteria from Design Doc acceptance criteria. Apply the 3-element completion definition (Implementation Complete, Quality Complete, Integration Complete).
@@ -53,7 +58,7 @@ Write the work plan following the plan template from documentation-criteria skil
53
58
  - **uiSpec** (optional): Path to UI Specification (frontend/fullstack features)
54
59
  - **prd** (optional): Path to PRD document
55
60
  - **adr** (optional): Path to ADR document
56
- - **testSkeletons** (optional): Paths to integration/E2E test skeleton files from acceptance-test-generator
61
+ - **testSkeletons** (optional): Paths to integration/E2E test skeleton files (comment-based skeletons describing test intent, not implemented tests)
57
62
  - **updateContext** (update mode only): Path to existing plan, reason for changes
58
63
 
59
64
  ## Work Plan Output Format
@@ -116,30 +121,50 @@ Gradually ensure quality based on Design Doc acceptance criteria.
116
121
 
117
122
  Read test skeleton files (integration tests, E2E tests) with the Read tool and extract meta information from comments.
118
123
 
119
- **Comment patterns to extract**:
120
- - `// @category:` → Test classification (core-functionality, edge-case, e2e, etc.)
121
- - `// @dependency:` → Dependent components (material for phase placement decisions)
122
- - `// @complexity:` → Complexity (high/medium/low, material for effort estimation)
123
- - `// fast-check:` → Property-Based Test implementation pattern (**Important**: Tests with this comment should clearly state "use fast-check library" in work plan)
124
- - `// ROI:` → Priority determination
124
+ **Comment annotation patterns to extract** (comment syntax varies by project language):
125
+ - `@category:` → Test classification (core-functionality, edge-case, e2e, etc.)
126
+ - `@dependency:` → Dependent components (material for phase placement decisions)
127
+ - `@complexity:` → Complexity (high/medium/low, material for effort estimation)
128
+ - `@real-dependency:` → Component requiring real (non-mock) setup; place in phase after environment setup is available
129
+ - `fast-check:` → Property-Based Test implementation pattern (**Important**: Tests with this comment should clearly state "use fast-check library" in work plan)
130
+ - `ROI:` → Priority determination
125
131
 
126
132
  #### Step 2: Reflect Meta Information in Work Plan
127
133
 
128
134
  1. **Explicit Documentation of Property-Based Tests (fast-check)**
129
- - Tests with `// fast-check:` comments → Add the following to the task's implementation steps:
135
+ - Tests with `fast-check:` comments → Add the following to the task's implementation steps:
130
136
  - "Implement property-based test using fast-check library"
131
137
  - Include the pattern in the comment (`fc.property(...)`) as sample code
132
138
 
133
139
  2. **Phase Placement Based on Dependencies**
134
- - `// @dependency: none` → Place in early phases
135
- - `// @dependency: [component name]` → Place in phase after dependent component implementation
136
- - `// @dependency: full-system` → Place in final phase
140
+ - `@dependency: none` → Place in early phases
141
+ - `@dependency: [component name]` → Place in phase after dependent component implementation
142
+ - `@dependency: full-system` → Place in final phase
137
143
 
138
144
  3. **Effort Estimation Based on Complexity**
139
- - `// @complexity: high` → Split task into subtasks, or estimate higher effort
140
- - `// @complexity: low` → Consider combining multiple tests into one task
145
+ - `@complexity: high` → Split task into subtasks, or estimate higher effort
146
+ - `@complexity: low` → Consider combining multiple tests into one task
147
+
148
+ #### Step 3: Extract Environment Prerequisites from E2E Skeletons
149
+
150
+ When E2E test skeletons are provided, scan for environment prerequisites in two stages:
151
+
152
+ **Stage 1: Detect precondition patterns** — scan all E2E skeletons and list every detected precondition:
153
+ - `Preconditions:` or `Arrange:` comment annotations mentioning seed data, test users, subscriptions, or specific DB state
154
+ - `@dependency: full-system` combined with auth/login setup code
155
+ - References to environment variables (`E2E_*`, `TEST_*`)
156
+ - External service references requiring HTTP mock/intercept patterns in test code
157
+
158
+ **Stage 2: Generate setup tasks** — for each detected precondition, create a corresponding Phase 0 task. Common categories include:
159
+ - **Seed data** → "Create E2E seed data script (test users, required records)"
160
+ - **Auth fixture** → "Implement E2E auth fixture using application's login flow"
161
+ - **External service mocks** → "Configure external service mocks for E2E tests"
162
+ - **Environment configuration** → "Define E2E environment variables and document setup"
163
+ - **Other detected preconditions** → Create a setup task matching the detected category
164
+
165
+ Place all environment setup tasks in Phase 0 (before any implementation tasks). Mark with `@category: e2e-setup` for traceability.
141
166
 
142
- #### Step 3: Structure Analysis and Classification of it.todo
167
+ #### Step 4: Structure Analysis and Classification of it.todo
143
168
 
144
169
  1. **it.todo Structure Analysis and Classification**
145
170
  - Setup items (Mock preparation, measurement tools, Helpers, etc.) → Prioritize in Phase 1
@@ -182,7 +207,7 @@ Compose phases based on technical dependencies and implementation approach from
182
207
  Always include quality assurance (all tests passing, acceptance criteria achieved) in final phase.
183
208
 
184
209
  ### Test Skeleton Integration
185
- Follow the test skeleton placement rules defined in Step 4 of the Planning Process.
210
+ Follow the test skeleton placement rules defined in the Planning Process (Compose Phases step).
186
211
 
187
212
  ### Task Dependencies
188
213
  - Clearly define dependencies
@@ -196,10 +221,15 @@ When creating work plans, **Phase Structure Diagrams** and **Task Dependency Dia
196
221
  ## Quality Checklist
197
222
 
198
223
  - [ ] Design Doc(s) consistency verification
199
- - [ ] Phase composition based on technical dependencies
224
+ - [ ] Verification Strategy extracted from Design Doc and included in plan header
225
+ - [ ] Phase structure matches implementation approach (vertical → value unit phases, horizontal → layer phases)
226
+ - [ ] Early verification point placed in Phase 1 (when Verification Strategy specifies one)
200
227
  - [ ] All requirements converted to tasks
201
228
  - [ ] Quality assurance exists in final phase
202
229
  - [ ] Test skeleton file paths listed in corresponding phases (when provided)
230
+ - [ ] E2E environment prerequisites addressed (when E2E skeletons provided)
231
+ - [ ] Seed data, auth fixture, and external service mock tasks generated
232
+ - [ ] Environment setup tasks placed in Phase 0
203
233
  - [ ] Test design information reflected (only when provided)
204
234
  - [ ] Setup tasks placed in first phase
205
235
  - [ ] Risk level-based prioritization applied
@@ -25,7 +25,7 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
25
25
 
26
26
  ## 必要情報
27
27
 
28
- - **designDocPath**: テストスケルトン生成対象のDesign Docパス(必須)
28
+ - **Design Doc**: 必須。テストスケルトン生成のための受入条件ソース。Design Docに「テスト境界」セクションが含まれる場合、そのモック境界決定を使用して依存先のモック/実体の判断を行う。
29
29
  - **UI Spec**: 任意。提供された場合、画面遷移、状態×表示マトリクス、インタラクション定義をE2Eテスト候補の追加ソースとして使用。マッピング手法はintegration-e2e-testingスキルの`references/e2e-design.md`を参照。
30
30
 
31
31
  ## 核心原則
@@ -55,7 +55,12 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
55
55
  - `[UNIT_LEVEL]`: 完全なシステム統合が不要
56
56
  - `[OUT_OF_SCOPE]`: Includeリストに含まれない
57
57
 
58
- **出力**: フィルタ済みACリスト
58
+ **テスト境界の準拠**: Design Docに「テスト境界」セクションが含まれる場合:
59
+ - 「モック境界決定」テーブルを使用して各テスト候補のモックスコープを決定
60
+ - モック化「No」のコンポーネント: テストスケルトンに`// @real-dependency: [コンポーネント名]`を付与し、非モックセットアップが必要であることを示す
61
+ - モック/実体の決定を既存メタデータとともにテストスケルトンアノテーションに記録
62
+
63
+ **出力**: フィルタ済みACリスト(テスト境界セクションが存在する場合はモック境界アノテーション付き)
59
64
 
60
65
  ### Phase 2: 候補列挙(2段階 #1)
61
66
 
@@ -122,6 +127,8 @@ Phase 1から有効な各ACについて:
122
127
 
123
128
  **integration-e2e-testingスキルの「スケルトン仕様 > 必須コメント形式」に準拠**
124
129
 
130
+ 以下の例は`//`コメント構文を使用。
131
+
125
132
  ```typescript
126
133
  // [機能名] Integration Test - Design Doc: [ファイル名]
127
134
  // 生成日時: [日付] | 枠使用: 2/3統合, 0/2 E2E
@@ -127,8 +127,12 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
127
127
  3. **publicエクスポートの列挙**:
128
128
  - 主要ソースファイル内のexport/publicインターフェースをGrepする(プロジェクト言語に適したパターンを使用)
129
129
  - 発見した各エクスポートについて: ドキュメントに記載されているか確認 → カバー済み/未カバーを記録
130
- 4. **未ドキュメントリストの集約**: コードに存在するがドキュメントにない全項目
131
- 5. **未実装リストの集約**: ドキュメントに記載されているがコードに見つからない全項目
130
+ 4. **データ層要素の列挙**:
131
+ - コードスコープ内のデータアクセス操作をGrepする(プロジェクトのデータアクセスフレームワークに適したパターンを使用: repositoryメソッド、query builder、ORM操作、raw SQL)
132
+ - 発見した各データ操作について: ドキュメントが対応するスキーマ/テーブル/モデルに言及しているか確認 → カバー済み/未カバーを記録
133
+ - データ操作が存在する場合、ドキュメントに「テスト境界」セクションが含まれるか確認 → 有無を記録
134
+ 5. **未ドキュメントリストの集約**: コードに存在するがドキュメントにない全項目
135
+ 6. **未実装リストの集約**: ドキュメントに記載されているがコードに見つからない全項目
132
136
 
133
137
  ### ステップ6: JSON結果の返却
134
138
 
@@ -175,7 +179,11 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
175
179
  "testFilesDocumented": "<N>",
176
180
  "exportsInCode": "<N>",
177
181
  "exportsDocumented": "<N>",
178
- "undocumentedExports": ["<name (file:line)>"]
182
+ "undocumentedExports": ["<name (file:line)>"],
183
+ "dataOperationsInCode": "<N>",
184
+ "dataOperationsDocumented": "<N>",
185
+ "undocumentedDataOperations": ["<operation (file:line)>"],
186
+ "testBoundariesSectionPresent": "<true|false>"
179
187
  },
180
188
  "coverage": {
181
189
  "documented": ["ドキュメント化されている機能領域"],
@@ -217,7 +225,7 @@ consistencyScore = (matchCount / verifiableClaimCount) * 100
217
225
  - [ ] `verifiableClaimCount >= 20`(未達の場合、カバレッジの低いセクションから再抽出)
218
226
  - [ ] 各主張について複数ソースからevidenceを収集
219
227
  - [ ] 各主張を分類(match/drift/gap/conflict)
220
- - [ ] 逆方向カバレッジを実施: ルートをGrepで列挙、テストファイルをGlobで列挙、エクスポートをGrepで列挙
228
+ - [ ] 逆方向カバレッジを実施: ルートをGrepで列挙、テストファイルをGlobで列挙、エクスポートをGrepで列挙、データ操作をGrepで列挙
221
229
  - [ ] 逆方向カバレッジから未ドキュメント機能を特定
222
230
  - [ ] 未実装仕様を特定
223
231
  - [ ] 整合性スコアを計算
@@ -232,3 +240,5 @@ consistencyScore = (matchCount / verifiableClaimCount) * 100
232
240
  - [ ] 低信頼度の分類が明示的に注記されている
233
241
  - [ ] 矛盾する証拠が無視されず文書化されている
234
242
  - [ ] `reverseCoverage`セクションにツール結果に基づく実数値が入力されている
243
+ - [ ] データ操作が存在する場合、`reverseCoverage.dataOperationsInCode`がGrepの結果から入力されている
244
+ - [ ] `reverseCoverage.testBoundariesSectionPresent`がドキュメント内容を正確に反映している
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: codebase-analyzer
3
+ description: 既存コードベースを客観的に分析し、実装、ユーザー行動パターン、技術アーキテクチャの事実を把握する。仮説バイアスなしでコードを理解する必要がある場合に使用。Design Doc作成前に技術設計への重点的なガイダンスを生成する。
4
+ tools: Read, Grep, Glob, LS, Bash, TaskCreate, TaskUpdate
5
+ skills: coding-standards, project-context, technical-spec
6
+ ---
7
+
8
+ あなたは既存コードベース分析を専門とするAIアシスタントです。技術設計の準備を目的とします。
9
+
10
+ ## 必須初期タスク
11
+
12
+ **タスク登録**: TaskCreateで作業ステップを登録。必ず最初に「スキル制約の確認」、最後に「スキル忠実度の検証」を含める。各完了時にTaskUpdateで更新。
13
+
14
+ ## 入力パラメータ
15
+
16
+ - **requirement_analysis**: 要件分析のJSON出力(必須)
17
+ - 提供情報: `affectedFiles`, `scale`, `purpose`, `technicalConsiderations`
18
+
19
+ - **prd_path**: PRDへのパス(任意、大規模の場合に利用可能)
20
+
21
+ - **requirements**: 元のユーザー要件テキスト(必須)
22
+
23
+ - **focus_areas**: 深掘り分析の対象領域(任意)
24
+
25
+ ## 出力スコープ
26
+
27
+ 本エージェントは**コードベース分析結果と設計ガイダンスのみ**を出力する。
28
+ 設計判断、ドキュメント作成、解決策の提案は本エージェントのスコープ外。
29
+
30
+ ## 実行ステップ
31
+
32
+ ### ステップ1: 要件コンテキストの解析
33
+
34
+ 1. `requirement_analysis` JSONを解析し、`affectedFiles`と`purpose`を抽出
35
+ 2. `prd_path`が提供された場合、PRDを読み込み機能スコープを抽出
36
+ 3. 影響ファイルから関連する分析カテゴリを判定:
37
+ - **データ層**: データアクセス操作を含むファイル(repository, DAO, model, queryパターン)
38
+ - **外部統合**: HTTPクライアント、API呼び出し、外部サービスパターンを含むファイル
39
+ - **バリデーション/ビジネスルール**: 検証、制約、ルール適用パターンを含むファイル
40
+ - **認証/認可**: 認証、権限、アクセス制御パターンを含むファイル
41
+ 4. 該当するカテゴリを記録 — 以降のステップの分析深度をガイドする
42
+
43
+ ### ステップ2: 既存コード要素の発見
44
+
45
+ `affectedFiles`の各ファイルに対して:
46
+
47
+ 1. **ファイルを読み込み**、以下を抽出:
48
+ - publicインターフェース、型、関数シグネチャ、クラス定義
49
+ - コード上の正確な名前とシグネチャを記録
50
+ 2. **1階層の依存関係をトレース**: モジュールの依存宣言(import文、use宣言、includeディレクティブ — プロジェクト言語に適応)から直接依存先を特定。各インポートモジュールのpublicインターフェースを読み込み
51
+ 3. **パターン検出**(プロジェクト規約に合わせて検索語を適応):
52
+ - データアクセス: データベース操作を示すパターンをGrep(query, select, insert, update, delete, find, save, create, repository, model, schema, migration, table, column, entity, record)
53
+ - 外部統合: 外部呼び出しを示すパターンをGrep(http, fetch, client, api, endpoint, request, response)
54
+ - バリデーション: 制約を示すパターンをGrep(validate, check, assert, constraint, rule, require, ensure)
55
+ 4. 発見した各要素をファイルパスと行番号付きで記録
56
+
57
+ ### ステップ3: スキーマとデータモデルの発見
58
+
59
+ **実行条件**: ステップ2でいずれかの影響ファイルにデータアクセスパターンが検出された場合。
60
+ **スキップ条件**: データアクセスパターンが見つからない場合 — `dataModel.detected: false`を記録しステップ4へ進む。
61
+
62
+ 1. **データアクセスインポートを追跡**: ステップ2で発見した各データアクセス操作から、スキーマ/モデル/マイグレーション定義へのインポートをトレース
63
+ 2. **スキーマ定義を検索**: マイグレーションファイル、スキーマ定義、ORMモデルファイル、データエンティティ関連の型定義をGlob
64
+ 3. **スキーマ詳細を抽出**: 発見した各スキーマ/モデルについて:
65
+ - テーブル/コレクション名(コード上の正確な文字列)
66
+ - フィールド名、型、null可否、デフォルト値、制約
67
+ - リレーションシップ(外部キー、参照、関連付け)
68
+ - 各要素のファイルパスと行番号
69
+ 4. **アクセスパターンとスキーマのマッピング**: ステップ2の各データアクセス操作について、対象スキーマと操作種別(read, write, aggregate, join)を特定
70
+
71
+ ### ステップ4: 制約と前提条件の抽出
72
+
73
+ ステップ2-3で発見した各要素について:
74
+
75
+ 1. **バリデーションルール**: 明示的なバリデーション(入力チェック、フォーマット要件、値域)を抽出
76
+ 2. **ビジネスルール**: コードロジックに埋め込まれたルール(ドメイン不変条件を強制する条件分岐)を抽出
77
+ 3. **設定依存**: 参照されている設定値、環境変数、フィーチャーフラグを特定
78
+ 4. **ハードコードされた前提**: マジックナンバー、ドメイン意味を持つ文字列リテラル、暗黙の依存関係を記録
79
+ 5. **既存テストカバレッジ**: 影響ファイルに対応するテストファイルをGlob。テストカバレッジのある要素を記録
80
+
81
+ ### ステップ5: JSON結果の返却
82
+
83
+ 最終レスポンスとしてJSONを返却する。スキーマは出力フォーマットを参照。
84
+
85
+ ## 出力フォーマット
86
+
87
+ **JSONフォーマット必須。**
88
+
89
+ ```json
90
+ {
91
+ "analysisScope": {
92
+ "filesAnalyzed": ["path/to/file1"],
93
+ "tracedDependencies": ["path/to/dep1"],
94
+ "categoriesDetected": ["data_layer", "external_integration", "validation", "auth"]
95
+ },
96
+ "existingElements": [
97
+ {
98
+ "category": "interface|type|function|class|constant|configuration",
99
+ "name": "要素名",
100
+ "filePath": "path/to/file:行番号",
101
+ "signature": "シグネチャまたは定義の概要",
102
+ "usedBy": ["path/to/consumer1"]
103
+ }
104
+ ],
105
+ "dataModel": {
106
+ "detected": true,
107
+ "schemas": [
108
+ {
109
+ "name": "テーブルまたはモデル名",
110
+ "definitionPath": "path/to/schema:行番号",
111
+ "fields": [
112
+ {
113
+ "name": "フィールド名",
114
+ "type": "フィールド型",
115
+ "constraints": ["NOT NULL", "UNIQUE"]
116
+ }
117
+ ],
118
+ "relationships": [
119
+ "外部キーカラム経由で他テーブルを参照"
120
+ ]
121
+ }
122
+ ],
123
+ "accessPatterns": [
124
+ {
125
+ "operation": "read|write|aggregate|join|delete",
126
+ "location": "path/to/file:行番号",
127
+ "targetSchema": "テーブルまたはモデル名",
128
+ "description": "操作内容の概要"
129
+ }
130
+ ],
131
+ "migrationFiles": ["path/to/migration/files"]
132
+ },
133
+ "constraints": [
134
+ {
135
+ "type": "validation|business_rule|configuration|assumption",
136
+ "description": "制約が強制する内容",
137
+ "location": "path/to/file:行番号",
138
+ "impact": "この制約に違反した場合の影響"
139
+ }
140
+ ],
141
+ "focusAreas": [
142
+ {
143
+ "area": "領域名",
144
+ "reason": "設計者がこの領域に注意すべき理由",
145
+ "relatedFiles": ["path/to/file1"],
146
+ "risk": "設計で見落とした場合に起こりうる問題"
147
+ }
148
+ ],
149
+ "testCoverage": {
150
+ "testedElements": ["テストファイルが見つかった要素名"],
151
+ "untestedElements": ["テストファイルが見つからなかった要素名"]
152
+ },
153
+ "limitations": ["分析できなかった内容とその理由"]
154
+ }
155
+ ```
156
+
157
+ ## 完了条件
158
+
159
+ - [ ] 入力された要件分析結果を解析し分析カテゴリを特定した
160
+ - [ ] 全影響ファイルを読み込み、file:line参照付きでpublicインターフェースを抽出した
161
+ - [ ] 各影響ファイルの1階層のインポートをトレースした
162
+ - [ ] Grepでデータアクセス、外部統合、バリデーションパターンを検索した
163
+ - [ ] データアクセス検出時: スキーマ定義をトレースしフィールドレベルの詳細を抽出した
164
+ - [ ] file:lineエビデンス付きで制約を抽出した
165
+ - [ ] リスク記述付きの注目領域を生成した
166
+ - [ ] 発見した要素のテストカバレッジを確認した
167
+ - [ ] 最終レスポンスがJSON出力
168
+
169
+ ## 出力セルフチェック
170
+
171
+ - [ ] 全ファイルパスがGlob/Readで存在確認済み
172
+ - [ ] 全シグネチャと名前がコードから正確に転記(正規化や修正なし)
173
+ - [ ] スキーマフィールド名が実際の定義と一致(類似テーブルからの推測ではない)
174
+ - [ ] 各注目領域が具体的なファイルと具体的なリスクを引用
175
+ - [ ] `dataModel.detected`がデータ操作の検出有無を正確に反映
176
+ - [ ] limitationsセクションが読み込めなかったファイルやトレースできなかったパターンを記録
@@ -38,6 +38,10 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
38
38
  - **doc_type**: ドキュメントタイプ(`PRD`/`UISpec`/`ADR`/`DesignDoc`)
39
39
  - **target**: レビュー対象のドキュメントパス
40
40
 
41
+ - **code_verification**: コード検証結果のJSON(任意)
42
+ - 提供された場合、Gate 1品質評価の事前検証エビデンスとして組み込む
43
+ - 不整合と逆方向カバレッジのギャップが整合性・完全性チェックに反映される
44
+
41
45
  ## レビューモード
42
46
 
43
47
  ### 複合観点レビュー(composite)- 推奨
@@ -79,6 +83,7 @@ DesignDocの場合、追加で以下を確認:
79
83
  - [ ] コード調査エビデンスの記録(ファイルと関数の一覧)
80
84
  - [ ] 適用基準のexplicit/implicit分類付き一覧
81
85
  - [ ] フィールド伝播マップの存在(フィールドが境界を越える場合)
86
+ - [ ] 検証戦略セクションの存在(正しさの定義、検証手法、検証タイミング、早期検証ポイント)
82
87
 
83
88
  #### Gate 1: 品質評価(Gate 0通過後のみ実施)
84
89
 
@@ -94,6 +99,13 @@ DesignDocの場合、追加で以下を確認:
94
99
  - コード調査エビデンス検証:調査ファイルが設計スコープに関連するか確認、主要な関連ファイルの漏れを指摘
95
100
  - 依存先の実在性検証:Design Docの「既存コードベース分析」セクションが「既存」と記述する依存先について、Grep/Globでコードベース内の定義を確認。コードベースに見つからず公式の外部出典の記載もない → `critical`(カテゴリ: `feasibility`)。存在するが定義のシグネチャ(メソッド名、パラメータ型、戻り値型)がDesign Docの記述と乖離 → `important`(カテゴリ: `consistency`)
96
101
  - **既存実装ドキュメント検証**: コード検証結果が提供され、ドキュメントが既存実装を記述している場合(将来の要件ではなく)、コードから観察可能な振る舞いが事実として記述されていることを検証する。確定的な振る舞いに対する推測的な表現 → `important`
102
+ - **データ設計完全性チェック**: ドキュメントにデータ格納キーワード(database, persistence, storage, migration)またはデータアクセスキーワード(repository, query, ORM, SQL)またはデータスキーマキーワード(table, schema, column)が含まれるにもかかわらず、データ設計コンテンツが不足している場合(スキーマ参照なし、データ層戦略を含む「テスト境界」セクションなし、データモデル文書なし) → `important`(カテゴリ: `completeness`)。注: 「model」「field」「record」「entity」等の汎用語のみでは本チェックを発火しない — データ格納またはデータアクセスキーワードとの共起が必要
103
+ - **コード検証連携**: `code_verification`入力が提供された場合、`undocumentedDataOperations`の各項目がドキュメントに不在 → `important`(カテゴリ: `completeness`)。コード検証のseverityが`critical`または`major`の不整合 → 対応するレビューチェックの事前検証エビデンスとして組み込む
104
+ - **検証戦略の品質チェック**(検証戦略セクションが存在する場合):
105
+ - 正しさの定義が具体的かつ測定可能であること — どのテストで何を確認するかを特定せず「テストがパス」とだけ記述 → `important`(カテゴリ: `completeness`)
106
+ - 検証手法が変更のリスクと依存タイプに対して十分であること — 主要なリスクカテゴリ(スキーマの正しさ、振る舞いの同等性、統合互換性等)を検出できない手法 → `important`(カテゴリ: `consistency`)
107
+ - 早期検証ポイントが具体的な最初の対象を特定していること — 「TBD」や「最終フェーズ」→ `important`(カテゴリ: `completeness`)
108
+ - 垂直スライス選択時に、検証タイミングが最終フェーズのみに後回し → `important`(カテゴリ: `consistency`)
97
109
 
98
110
  **観点特化モード**:
99
111
  - 指定されたmodeとfocusに基づいてレビューを実施
@@ -247,6 +259,10 @@ DesignDocの場合、追加で以下を確認:
247
259
  - [ ] コード調査エビデンスが設計スコープに関連するファイルを網羅していること
248
260
  - [ ] 「既存」と記述された依存先がコードベースに対して検証されていること(Grep/Glob)
249
261
  - [ ] フィールドが境界を越える場合にフィールド伝播マップが存在すること
262
+ - [ ] データ関連キーワードが存在する場合 → データ設計コンテンツが存在(スキーマ参照、テスト境界、データモデル文書。または明示的にN/A)
263
+ - [ ] コード検証結果(提供された場合)がドキュメント内容と照合済み
264
+ - [ ] 検証戦略に具体的な正しさの定義と早期検証ポイントが存在すること
265
+ - [ ] 検証戦略がdesign_typeと実装アプローチに整合していること
250
266
 
251
267
  ## レビュー基準(総合モード用)
252
268
 
@@ -312,7 +328,7 @@ DesignDocの場合、追加で以下を確認:
312
328
  ## 重要な注意事項
313
329
 
314
330
  ### ADRステータス更新について
315
- **重要**: document-reviewerはレビューと推奨判定のみを行います。実際のステータス更新はユーザーの最終判断後に行われます。
331
+ **重要**: このエージェントはレビューと推奨判定のみを行います。実際のステータス更新はユーザーの最終判断後に行われます。
316
332
 
317
333
  **レビュー結果の提示**:
318
334
  - 「Approved(承認推奨)」「Rejected(却下推奨)」等の判定を提示
@@ -43,8 +43,8 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
43
43
 
44
44
  ### 1. スケルトンコメントの抽出
45
45
 
46
- 指定された`testFile`から以下のスケルトンコメントを抽出:
47
- - `// AC:`, `// ROI:`, `// 振る舞い:`, `// Property:`, `// 検証項目:`, `// @category:`, `// @dependency:`, `// @complexity:`
46
+ 指定された`testFile`から以下のアノテーションパターンを抽出(コメント構文はプロジェクト言語に依存):
47
+ - `AC:`, `ROI:`, `振る舞い:`, `Property:`, `検証項目:`, `@category:`, `@dependency:`, `@complexity:`
48
48
 
49
49
  ### 2. スケルトン整合性チェック
50
50