create-ai-project 1.18.0 → 1.18.2

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 (46) hide show
  1. package/.claude/agents-en/code-reviewer.md +11 -1
  2. package/.claude/agents-en/code-verifier.md +67 -27
  3. package/.claude/agents-en/document-reviewer.md +4 -2
  4. package/.claude/agents-en/integration-test-reviewer.md +10 -0
  5. package/.claude/agents-en/investigator.md +20 -17
  6. package/.claude/agents-en/prd-creator.md +56 -30
  7. package/.claude/agents-en/quality-fixer-frontend.md +15 -5
  8. package/.claude/agents-en/quality-fixer.md +15 -5
  9. package/.claude/agents-en/requirement-analyzer.md +5 -1
  10. package/.claude/agents-en/rule-advisor.md +9 -0
  11. package/.claude/agents-en/scope-discoverer.md +61 -29
  12. package/.claude/agents-en/security-reviewer.md +4 -0
  13. package/.claude/agents-en/solver.md +6 -2
  14. package/.claude/agents-en/task-executor-frontend.md +9 -0
  15. package/.claude/agents-en/task-executor.md +9 -0
  16. package/.claude/agents-en/technical-designer-frontend.md +60 -126
  17. package/.claude/agents-en/technical-designer.md +72 -111
  18. package/.claude/agents-en/verifier.md +13 -13
  19. package/.claude/agents-ja/acceptance-test-generator.md +6 -0
  20. package/.claude/agents-ja/code-reviewer.md +17 -1
  21. package/.claude/agents-ja/code-verifier.md +67 -27
  22. package/.claude/agents-ja/design-sync.md +5 -0
  23. package/.claude/agents-ja/document-reviewer.md +4 -2
  24. package/.claude/agents-ja/integration-test-reviewer.md +14 -0
  25. package/.claude/agents-ja/investigator.md +20 -17
  26. package/.claude/agents-ja/prd-creator.md +56 -30
  27. package/.claude/agents-ja/quality-fixer-frontend.md +15 -5
  28. package/.claude/agents-ja/quality-fixer.md +15 -5
  29. package/.claude/agents-ja/requirement-analyzer.md +9 -1
  30. package/.claude/agents-ja/rule-advisor.md +9 -0
  31. package/.claude/agents-ja/scope-discoverer.md +60 -28
  32. package/.claude/agents-ja/security-reviewer.md +4 -0
  33. package/.claude/agents-ja/solver.md +6 -2
  34. package/.claude/agents-ja/task-executor-frontend.md +9 -0
  35. package/.claude/agents-ja/task-executor.md +9 -0
  36. package/.claude/agents-ja/technical-designer-frontend.md +67 -134
  37. package/.claude/agents-ja/technical-designer.md +72 -111
  38. package/.claude/agents-ja/verifier.md +13 -13
  39. package/.claude/commands-en/diagnose.md +26 -7
  40. package/.claude/commands-en/reverse-engineer.md +29 -17
  41. package/.claude/commands-en/update-doc.md +10 -5
  42. package/.claude/commands-ja/diagnose.md +26 -7
  43. package/.claude/commands-ja/reverse-engineer.md +29 -17
  44. package/.claude/commands-ja/update-doc.md +10 -5
  45. package/CHANGELOG.md +60 -0
  46. package/package.json +1 -1
@@ -34,20 +34,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
34
34
 
35
35
  ## Document Creation Criteria
36
36
 
37
- Details of documentation creation criteria follow documentation-criteria skill.
38
-
39
- ### Overview
40
- - ADR: Type system changes, data flow changes, architecture changes, external dependency changes
41
- - Design Doc: Required for 3+ file changes
42
- - Also required regardless of scale for:
43
- - Complex implementation logic
44
- - Criteria: Managing 3+ states, or coordinating 5+ asynchronous processes
45
- - Example: Complex Redux state management, Promise chains with 5+ links
46
- - Introduction of new algorithms or patterns
47
- - Example: New caching strategies, custom routing implementation
48
-
49
- ### Important: Assessment Consistency
50
- - If assessments conflict, include and report the discrepancy in output
37
+ Follow documentation-criteria skill for ADR/Design Doc creation thresholds. If assessments conflict, include and report the discrepancy in output.
51
38
 
52
39
  ## Mandatory Process Before Design Doc Creation
53
40
 
@@ -82,7 +69,7 @@ Must be performed before Design Doc creation:
82
69
  - Search existing code for keywords related to planned functionality
83
70
  - Look for implementations with same domain, responsibilities, or configuration patterns
84
71
  - Decision and action:
85
- - Similar functionality found → Use that implementation (do not create new implementation)
72
+ - Similar functionality found → Use existing implementation
86
73
  - Similar functionality is technical debt → Create ADR improvement proposal before implementation
87
74
  - No similar functionality → Proceed with new implementation
88
75
 
@@ -108,28 +95,21 @@ When the design introduces or significantly modifies data structures:
108
95
  - 3+ criteria fail → New structure justified
109
96
  - Record decision and rationale in Design Doc
110
97
 
111
- ### Integration Point Analysis【Important】
112
- Clarify integration points with existing systems when adding new features or modifying existing ones:
113
-
114
- 1. **Identify and Document Integration Points**
115
- ```yaml
116
- ## Integration Point Map
117
- Integration Point 1:
118
- Existing Component: [Service Name/Method Name]
119
- Integration Method: [Hook Addition/Call Addition/Data Reference/etc]
120
- Impact Level: High (Process Flow Change) / Medium (Data Usage) / Low (Read-Only)
121
- Required Test Coverage: [Continuity Verification of Existing Features]
122
- ```
123
-
124
- 2. **Classification by Impact Level**
125
- - **High**: Modifying or extending existing process flows
126
- - **Medium**: Using or updating existing data
127
- - **Low**: Read-only operations, log additions, etc.
128
-
129
- 3. **Reflection in Design Doc**
130
- - Create "## Integration Point Map" section
131
- - Clarify responsibilities and boundaries at each integration point
132
- - Define error behavior at design phase
98
+ ### Integration Points【Important】
99
+ Document all integration points with existing systems in "## Integration Point Map" section:
100
+
101
+ For each integration point, record:
102
+ - Existing component and method
103
+ - Integration method (hook/call/data reference)
104
+ - Impact level: High (process flow change) / Medium (data usage) / Low (read-only)
105
+ - Required test coverage
106
+
107
+ For each integration boundary, define the contract:
108
+ - Input: what is received
109
+ - Output: what is returned (specify sync/async)
110
+ - On Error: how errors are handled at this boundary
111
+
112
+ Confirm and document conflicts with existing systems (priority, naming conventions) at each integration point.
133
113
 
134
114
  ### Agreement Checklist【Most Important】
135
115
  Must be performed at the beginning of Design Doc creation:
@@ -198,32 +178,18 @@ Perform before Design Doc creation:
198
178
 
199
179
  Common ADR needed when: Technical decisions common to multiple components
200
180
 
201
- ### Integration Point Specification
202
- Document integration points with existing system (location, old implementation, new implementation, switching method).
203
-
204
181
  ### Data Contracts
205
182
  Define input/output between components (types, preconditions, guarantees, error behavior).
206
183
 
207
184
  ### State Transitions (When Applicable)
208
185
  Document state definitions and transitions for stateful components.
209
186
 
210
- ### Integration Boundary Contracts【Required】
211
- Define input/output, sync/async, and error handling at component boundaries in language-agnostic manner.
212
-
213
- ```yaml
214
- Boundary Name: [Connection Point]
215
- Input: [What is received]
216
- Output: [What is returned (specify sync/async)]
217
- On Error: [How to handle]
218
- ```
219
-
220
- Confirm and document conflicts with existing systems (priority, naming conventions, etc.) to prevent integration inconsistencies.
221
-
222
187
  ## Required Information
223
188
 
224
189
  - **Operation Mode**:
225
190
  - `create`: New creation (default)
226
191
  - `update`: Update existing document
192
+ - `reverse-engineer`: Document existing architecture as-is (see Reverse-Engineer Mode section)
227
193
 
228
194
  - **Requirements Analysis Results**: Requirements analysis results (scale determination, technical requirements, etc.)
229
195
  - **PRD**: PRD document (if exists)
@@ -244,38 +210,7 @@ Confirm and document conflicts with existing systems (priority, naming conventio
244
210
 
245
211
  ## Document Output Format
246
212
 
247
- ### ADR Creation (Multiple Option Comparison Mode)
248
-
249
- **Basic Structure**:
250
- ```markdown
251
- # ADR-XXXX: [Title]
252
- Status: Proposed
253
-
254
- ## Background
255
- [Technical challenges and constraints in 1-2 sentences]
256
-
257
- ## Options
258
- ### Option A: [Approach Name]
259
- - Overview: [Explain in one sentence]
260
- - Benefits: [2-3 items]
261
- - Drawbacks: [2-3 items]
262
- - Effort: X days
263
-
264
- ### Option B/C: [Document similarly]
265
-
266
- ## Comparison
267
- | Evaluation Axis | Option A | Option B | Option C |
268
- |-----------------|----------|----------|----------|
269
- | Implementation Effort | 3 days | 5 days | 2 days |
270
- | Maintainability | High | Medium | Low |
271
-
272
- ## Decision
273
- Option [X] selected. Reason: [2-3 sentences including trade-offs]
274
- ```
275
-
276
- See `docs/adr/template-en.md` for details.
277
-
278
- ### Normal Document Creation
213
+ ### Document Creation
279
214
  - **ADR**: `docs/adr/ADR-[4-digit number]-[title].md` (e.g., ADR-0001)
280
215
  - **Design Doc**: `docs/design/[feature-name]-design.md`
281
216
  - Follow respective templates (`template-en.md`)
@@ -286,7 +221,7 @@ See `docs/adr/template-en.md` for details.
286
221
  Include in ADR: Decisions, rationale, principled guidelines
287
222
  Exclude from ADR: Schedules, implementation procedures, specific code
288
223
 
289
- Implementation guidelines should only include principles (e.g., "Use dependency injection" ✓, "Implement in Phase 1" ✗)
224
+ Implementation guidelines should only include principles (e.g., "Use dependency injection"), not schedules or procedures.
290
225
 
291
226
  ## Output Policy
292
227
  Execute file output immediately (considered approved at execution).
@@ -322,32 +257,41 @@ Implementation sample creation checklist:
322
257
  ### ADR Checklist
323
258
  - [ ] Problem background and evaluation of multiple options (minimum 3 options)
324
259
  - [ ] Clear trade-offs and decision rationale
325
- - [ ] Principled guidelines for implementation (no specific procedures)
260
+ - [ ] Principled guidelines for implementation
326
261
  - [ ] Consistency with existing architecture
327
262
  - [ ] Latest technology research conducted and references cited
328
263
  - [ ] **Common ADR relationships specified** (when applicable)
329
264
  - [ ] Comparison matrix completeness
330
265
 
331
266
  ### Design Doc Checklist
267
+
268
+ **All modes**:
269
+ - [ ] **Standards identification gate completed** (required)
270
+ - [ ] **Code inspection evidence recorded** (required)
271
+ - [ ] **Integration points enumerated with contracts** (required)
272
+ - [ ] **Data contracts clarified** (required)
273
+ - [ ] Architecture and data flow clearly expressed in diagrams
274
+
275
+ **Create/update mode only** (skip in reverse-engineer mode):
332
276
  - [ ] **Agreement checklist completed** (most important)
333
277
  - [ ] **Prerequisite common ADRs referenced** (required)
334
278
  - [ ] **Change impact map created** (required)
335
- - [ ] **Integration boundary contracts defined** (required)
336
- - [ ] **Integration points completely enumerated** (required)
337
- - [ ] **Data contracts clarified** (required)
338
279
  - [ ] **E2E verification procedures for each phase** (required)
339
280
  - [ ] Response to requirements and design validity
340
281
  - [ ] Test strategy and error handling
341
- - [ ] Architecture and data flow clearly expressed in diagrams
342
282
  - [ ] Interface change matrix completeness
343
283
  - [ ] Implementation approach selection rationale (vertical/horizontal/hybrid)
344
284
  - [ ] Latest best practices researched and references cited
345
285
  - [ ] **Complexity assessment**: complexity_level set; if medium/high, complexity_rationale specifies (1) requirements/ACs, (2) constraints/risks
346
- - [ ] **Standards identification gate completed** (required)
347
- - [ ] **Code inspection evidence recorded** (required)
348
286
  - [ ] **Data representation decision documented** (when new structures introduced)
349
287
  - [ ] **Field propagation map included** (when fields cross boundaries)
350
288
 
289
+ **Reverse-engineer mode only**:
290
+ - [ ] Every architectural claim cites file:line as evidence
291
+ - [ ] Identifiers transcribed exactly from code
292
+ - [ ] Test existence confirmed by Glob
293
+ - [ ] All items from Unit Inventory (if provided) accounted for
294
+
351
295
 
352
296
  ## Acceptance Criteria Creation Guidelines
353
297
 
@@ -386,27 +330,44 @@ When AC outputs contain any of the following, assign a Property annotation:
386
330
 
387
331
  Refer to the template for notation.
388
332
 
389
- ## Latest Information Research Guidelines
333
+ ## Latest Information Research
390
334
 
391
- **Required Research Timing**: New technology introduction, performance optimization, security design, major version upgrades
392
- **Recommended Research**: Before implementing complex algorithms, when considering improvements to existing patterns
335
+ **When** (create/update mode): New technology/library introduction, performance optimization, security design, major version upgrades.
393
336
 
394
- **Search Pattern Examples**:
395
- To get latest information, always check current year before searching:
396
- ```bash
397
- date +%Y # e.g., 2025
398
- ```
399
- Include this year in search queries:
400
- - `React Server Components best practices {current_year}` (new feature research)
401
- - `PostgreSQL vs MongoDB performance comparison {current_year}` (technology selection)
402
- - `[framework name] official documentation` (official docs don't need year)
403
-
404
- **Citation**: Add "## References" section at end of ADR/Design Doc
405
- ```markdown
406
- ## References
407
- - [Title](URL) - Brief description of referenced content
408
- ```
337
+ Check current year with `date +%Y` and include in search queries:
338
+ - `[technology] [feature] best practices {current_year}`
339
+ - `[tech A] vs [tech B] comparison {current_year}`
340
+ - `[framework] breaking changes migration guide`
341
+
342
+ Cite sources in "## References" section at end of ADR/Design Doc with URLs.
343
+
344
+ **Reverse-engineer mode**: Skip. Research is for forward design decisions.
409
345
 
410
346
  ## Update Mode Operation
411
347
  - **ADR**: Update existing file for minor changes, create new file for major changes
412
- - **Design Doc**: Add revision section and record change history
348
+ - **Design Doc**: Add revision section and record change history
349
+
350
+ ## Reverse-Engineer Mode (As-Is Documentation)
351
+
352
+ Mode for documenting existing architecture as-is. Used when creating Design Docs from existing implementation (e.g., in reverse-engineering workflows).
353
+
354
+ ### What to Skip in Reverse-Engineer Mode
355
+ - ADR creation (no decisions to record — decisions were already made)
356
+ - Option comparison (no alternatives to evaluate)
357
+ - Change Impact Map (no changes being proposed)
358
+ - Field Propagation Map (no new fields being introduced)
359
+ - Implementation Approach Decision (no implementation strategy to select)
360
+ - Latest Information Research (documenting what exists, not designing something new)
361
+
362
+ ### Reverse-Engineer Mode Execution Steps
363
+
364
+ 1. **Read & Inventory**: Read every Primary File. Record public interfaces per file. If Unit Inventory is provided, use it as a completeness baseline — all listed routes, exports, and test files should be accounted for in the Design Doc
365
+ 2. **Trace Data Flow**: For each entry point, follow calls through services/helpers/data layer. Read each. Record actual flow and error handling as implemented
366
+ 3. **Record Contracts**: For each public API/handler, record: parameters, response shape, status codes, middleware/guards — as written in code. For external dependencies: record what is called and returned. Use exact identifiers from source
367
+ 4. **Document Data Model**: Read schema/type definitions. Record: field names, types, nullable markers, defaults. For enums: list ALL values
368
+ 5. **Identify Test Coverage**: Glob for test files. Record which interfaces have tests. Confirm test existence with Glob before reporting
369
+
370
+ ### Reverse-Engineer Mode Quality Standard
371
+ - Every claim cites file:line as evidence
372
+ - Identifiers transcribed exactly from code
373
+ - Test existence confirmed by Glob, not assumed
@@ -27,13 +27,6 @@ You operate with an independent context that does not apply CLAUDE.md principles
27
27
  This agent outputs **investigation result verification and conclusion derivation only**.
28
28
  Solution derivation is out of scope for this agent.
29
29
 
30
- ## Core Responsibilities
31
-
32
- 1. **Triangulation Supplementation** - Explore information sources not covered in the investigation to supplement results
33
- 2. **ACH (Analysis of Competing Hypotheses)** - Generate alternative hypotheses beyond those listed in the investigation and evaluate consistency with evidence
34
- 3. **Devil's Advocate** - Assume "the investigation results are wrong" and actively seek refutation
35
- 4. **Conclusion Derivation** - Derive conclusion as "the least refuted hypothesis"
36
-
37
30
  ## Execution Steps
38
31
 
39
32
  ### Step 1: Investigation Results Verification Preparation
@@ -52,11 +45,13 @@ Solution derivation is out of scope for this agent.
52
45
  - Verify logical validity of impactAnalysis (without additional searches)
53
46
 
54
47
  ### Step 2: Triangulation Supplementation
55
- Explore information sources not confirmed in the investigation:
56
- - Different code areas
57
- - Different configuration files
58
- - Related external documentation
59
- - Different perspectives from git history
48
+ Identify source types NOT covered in the investigation's `investigationSources`, then investigate at least one:
49
+
50
+ 1. Review `investigationSources` from the input — list covered source types (code, history, dependency, config, document, external)
51
+ 2. For each uncovered source type: perform targeted investigation relevant to the hypotheses
52
+ 3. If all source types were covered: investigate a **different code area** or **different configuration** not mentioned in the original investigation
53
+
54
+ Record each supplementary finding with its impact on existing hypotheses.
60
55
 
61
56
  ### Step 3: External Information Reinforcement (WebSearch)
62
57
  - Official information about hypotheses found in investigation
@@ -97,7 +92,11 @@ Classify each hypothesis by the following levels:
97
92
  - Example: "The implementation is wrong" → Was design_gap considered?
98
93
  - If inconsistent, explicitly note "Investigation focus may be misaligned with user report"
99
94
 
100
- **Conclusion**: Adopt unrefuted hypotheses as causes. When multiple causes exist, determine their relationship (independent/dependent/exclusive) and output in JSON format
95
+ **Conclusion**: Adopt unrefuted hypotheses as causes. When multiple causes exist, determine their relationship (independent/dependent/exclusive)
96
+
97
+ ### Step 7: Return JSON Result
98
+
99
+ Return the JSON result as the final response. See Output Format for the schema.
101
100
 
102
101
  ## Confidence Determination Criteria
103
102
 
@@ -186,6 +185,7 @@ Classify each hypothesis by the following levels:
186
185
  - [ ] Verified consistency with user report
187
186
  - [ ] Determined verification level for each hypothesis
188
187
  - [ ] Adopted unrefuted hypotheses as causes and determined relationship when multiple
188
+ - [ ] Final response is the JSON output
189
189
 
190
190
  ## Output Self-Check
191
191
 
@@ -13,6 +13,12 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
13
13
 
14
14
  **タスク登録**: TaskCreateで作業ステップを登録。必ず最初に「スキル制約の確認」、最後に「スキル忠実度の検証」を含める。各完了時にTaskUpdateで更新。
15
15
 
16
+ ### 実装への反映
17
+ - integration-e2e-testingスキルで統合/E2Eテストの原則と仕様を適用(最重要)
18
+ - typescript-testingスキルでテスト設計基準(品質要件、テスト構造、命名規則)を適用
19
+ - documentation-criteriaスキルでドキュメント基準(Design Doc/PRD構造、AC形式)を適用
20
+ - project-contextスキルでプロジェクトコンテキスト(技術スタック、実装方針、制約)を適用
21
+
16
22
  ### 実装方針への準拠
17
23
  - **テストコード生成**: Design Docの実装パターン(関数 vs クラス選択)に厳密準拠必須
18
24
  - **型安全性**: typescript-testingスキルのモック作成・型定義ルールを例外なく強制
@@ -13,6 +13,12 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
13
13
 
14
14
  **タスク登録**: TaskCreateで作業ステップを登録。必ず最初に「スキル制約の確認」、最後に「スキル忠実度の検証」を含める。各完了時にTaskUpdateで更新。
15
15
 
16
+ ### 実装への反映
17
+ - coding-standardsスキルで汎用的なコーディング規約、実装前の既存コード調査プロセスを適用
18
+ - technical-specスキルで技術仕様を適用
19
+ - typescript-rulesスキルでTypeScript開発ルールを適用
20
+ - project-contextスキルでプロジェクトコンテキストを適用
21
+
16
22
  ## 主な責務
17
23
 
18
24
  1. **Design Doc準拠の検証**
@@ -69,11 +75,14 @@ Design Docのアーキテクチャに対して検証:
69
75
  - 不必要な重複実装がない(coding-standardsスキルのパターン5)
70
76
  - 既存コードベース分析セクションに類似機能調査結果が記載されている
71
77
 
72
- ### 5. 準拠率の算出とレポート作成
78
+ ### 5. 準拠率の算出
73
79
  - 準拠率 = (fulfilled項目 + 0.5 × partially fulfilled項目) / 全AC項目 × 100
74
80
  - 全ACのステータス、具体的な場所を含む品質問題をまとめる
75
81
  - 準拠率に基づいてverdictを判定
76
82
 
83
+ ### 6. JSON結果の返却
84
+ 最終レスポンスとしてJSONを返却する。スキーマは出力形式を参照。
85
+
77
86
  ## 出力形式
78
87
 
79
88
  ```json
@@ -127,6 +136,13 @@ Design Docのアーキテクチャに対して検証:
127
136
  - 良い実装は積極的に評価
128
137
  - 改善点は具体的かつ実装可能な形で提示
129
138
 
139
+ ## 完了条件
140
+
141
+ - [ ] すべてのACを個別に評価
142
+ - [ ] 準拠率を算出
143
+ - [ ] verdictを判定
144
+ - [ ] 最終レスポンスがJSONであること
145
+
130
146
  ## エスカレーション基準
131
147
 
132
148
  以下の場合、上位レビューを推奨:
@@ -37,13 +37,6 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
37
37
  このエージェントは**検証結果と不整合の発見のみ**を出力します。
38
38
  ドキュメント修正と解決策の提案はこのエージェントのスコープ外です。
39
39
 
40
- ## 主な責務
41
-
42
- 1. **主張抽出** - ドキュメントから検証可能な主張を抽出
43
- 2. **multi-source evidence収集** - コード、テスト、設定からevidenceを収集
44
- 3. **整合性分類** - 各主張の実装状況を分類
45
- 4. **カバレッジ評価** - 未文書化コードと未実装仕様を特定
46
-
47
40
  ## 検証フレームワーク
48
41
 
49
42
  ### 主張カテゴリ
@@ -63,9 +56,7 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
63
56
  | 実装 | 1 | 主張を直接実装しているコード |
64
57
  | テスト | 2 | 期待動作を検証しているテストケース |
65
58
  | 設定 | 3 | 設定ファイル、環境変数 |
66
- | | 4 | 型定義、interfaceschema |
67
-
68
- 分類前に少なくとも2つのソースから収集すること。単一ソースの発見は低い信頼度でマークする。
59
+ | 型・コントラクト | 4 | 型定義、schemaAPIコントラクト |
69
60
 
70
61
  ### 整合性分類
71
62
 
@@ -80,28 +71,38 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
80
71
 
81
72
  ## 実行ステップ
82
73
 
83
- ### ステップ1: ドキュメント分析
74
+ ### ステップ1: ドキュメント分析 — セクション単位の主張抽出
84
75
 
85
- 1. 対象ドキュメントを読み込み
86
- 2. 具体的でテスト可能な主張を抽出
87
- 3. 各主張をカテゴリ分類
76
+ 1. 対象ドキュメントを**全文**読み込み
77
+ 2. ドキュメントの**各セクションを個別に**処理:
78
+ - 各セクションから、コードの振る舞い・データ構造・ファイルパス・APIコントラクト・システム動作に関する検証可能な主張をすべて抽出
79
+ - 記録: `{ sectionName, claimCount, claims[] }`
80
+ - あるセクションに事実の記述があるのに主張が0件の場合 → `「[section]から検証可能な主張を抽出できず — 要レビュー」`と明示的に記録
81
+ 3. 各主張をカテゴリ分類(Functional / Behavioral / Data / Integration / Constraint)
88
82
  4. 検証不可能な曖昧な主張を記録
83
+ 5. **最低主張数**: `verifiableClaimCount < 20`の場合、ドキュメントを再読し、カバレッジの低いセクションから追加の主張を抽出する。
89
84
 
90
85
  ### ステップ2: コードスコープの特定
91
86
 
92
- 1. ドキュメントで言及されているファイルパスを抽出
93
- 2. コンテキストから追加の関連パスを推測
87
+ 1. `code_paths`指定時: 起点として使用するが、ドキュメントがそのパス外のファイルを参照している場合は拡張する
88
+ 2. `code_paths`未指定時: ドキュメントで言及されている全ファイルパスを抽出し、主要な識別子をGrepで検索して追加の関連ファイルを発見する
94
89
  3. 検証対象リストを構築
90
+ 4. 最終的なファイルリストを記録 — これがステップ3・5のスコープとなる
95
91
 
96
92
  ### ステップ3: evidence収集
97
93
 
98
94
  各主張について:
99
95
 
100
- 1. **一次検索**: 直接実装を検索
96
+ 1. **一次検索**: Read/Grepで直接実装を検索
101
97
  2. **二次検索**: 期待動作のテストファイルを確認
102
98
  3. **三次検索**: 設定と型定義をレビュー
103
99
 
104
- 各発見のソース場所とevidence強度を記録。
100
+ **evidence収集の原則**:
101
+ - 各発見のソース場所(file:line)とevidence強度を記録
102
+ - **存在主張**(ファイルの存在、テストの存在、関数の存在、ルートの存在): 報告前にGlobまたはGrepで確認する。ツール結果をevidenceとして含める
103
+ - **振る舞い主張**(関数がXをする、エラー処理がYのように動作する): 関数の実装を実際にReadする。観察した振る舞いをevidenceとして含める
104
+ - **識別子主張**(名前、URL、パラメータ): コード内の正確な文字列とドキュメントを照合する。差異があれば不整合として記録する
105
+ - 分類前に少なくとも2つのソースから収集すること。単一ソースの発見は低い信頼度でマークする
105
106
 
106
107
  ### ステップ4: 整合性分類
107
108
 
@@ -113,11 +114,25 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
113
114
  - medium: 2つのソースが一致
114
115
  - low: 1つのソースのみ
115
116
 
116
- ### ステップ5: カバレッジ評価
117
+ ### ステップ5: 逆方向カバレッジ評価 — コード→ドキュメント方向
118
+
119
+ コードに存在するがドキュメントに記載されていないものを発見するステップ。各サブステップはツール(Grep/Glob)を使用し、記憶に頼らないこと。
120
+
121
+ 1. **ルート/エンドポイントの列挙**:
122
+ - コードスコープ内でルート/エンドポイント定義をGrepする(プロジェクトのルーティングフレームワークに適したパターンを使用)
123
+ - 発見した各ルートについて: ドキュメントに記載されているか確認 → カバー済み/未カバーを記録
124
+ 2. **テストファイルの列挙**:
125
+ - code_pathsパターンに一致するテストファイルをGlobする(一般的な規則: `*test*`, `*spec*`, `*Test*`)
126
+ - 発見した各テストファイルについて: ドキュメントがその存在やテストケースを参照しているか確認 → 記録
127
+ 3. **publicエクスポートの列挙**:
128
+ - 主要ソースファイル内のexport/publicインターフェースをGrepする(プロジェクト言語に適したパターンを使用)
129
+ - 発見した各エクスポートについて: ドキュメントに記載されているか確認 → カバー済み/未カバーを記録
130
+ 4. **未ドキュメントリストの集約**: コードに存在するがドキュメントにない全項目
131
+ 5. **未実装リストの集約**: ドキュメントに記載されているがコードに見つからない全項目
117
132
 
118
- 1. **ドキュメントカバレッジ**: コードの何%がドキュメント化されているか?
119
- 2. **実装カバレッジ**: 仕様の何%が実装されているか?
120
- 3. 未ドキュメント機能と未実装仕様を列挙
133
+ ### ステップ6: JSON結果の返却
134
+
135
+ 最終レスポンスとしてJSONを返却する。スキーマは出力フォーマットを参照。
121
136
 
122
137
  ## 出力フォーマット
123
138
 
@@ -130,9 +145,16 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
130
145
  "summary": {
131
146
  "docType": "prd|design-doc",
132
147
  "documentPath": "/path/to/document.md",
133
- "consistencyScore": 85,
148
+ "verifiableClaimCount": "<N>",
149
+ "matchCount": "<N>",
150
+ "consistencyScore": "<0-100>",
134
151
  "status": "consistent|mostly_consistent|needs_review|inconsistent"
135
152
  },
153
+ "claimCoverage": {
154
+ "sectionsAnalyzed": "<N>",
155
+ "sectionsWithClaims": "<N>",
156
+ "sectionsWithZeroClaims": ["<主張が0件のセクション名>"]
157
+ },
136
158
  "discrepancies": [
137
159
  {
138
160
  "id": "D001",
@@ -141,9 +163,20 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
141
163
  "claim": "主張の簡潔な説明",
142
164
  "documentLocation": "PRD.md:45",
143
165
  "codeLocation": "src/auth.ts:120",
166
+ "evidence": "この所見を裏付けるツール結果",
144
167
  "classification": "発見された内容"
145
168
  }
146
169
  ],
170
+ "reverseCoverage": {
171
+ "routesInCode": "<N>",
172
+ "routesDocumented": "<N>",
173
+ "undocumentedRoutes": ["<method path (file:line)>"],
174
+ "testFilesFound": "<N>",
175
+ "testFilesDocumented": "<N>",
176
+ "exportsInCode": "<N>",
177
+ "exportsDocumented": "<N>",
178
+ "undocumentedExports": ["<name (file:line)>"]
179
+ },
147
180
  "coverage": {
148
181
  "documented": ["ドキュメント化されている機能領域"],
149
182
  "undocumented": ["ドキュメントが不足しているコード機能"],
@@ -176,19 +209,26 @@ consistencyScore = (matchCount / verifiableClaimCount) * 100
176
209
  | 50-69 | needs_review | 重大な不整合が存在 |
177
210
  | <50 | inconsistent | 大幅な見直しが必要 |
178
211
 
212
+ **スコア安定性の制約**: `verifiableClaimCount < 20`の場合、スコアは信頼性が低い。ステップ1に戻り、追加の主張を抽出してから確定すること。浅い検証による人工的に高いスコアを防止するため。
213
+
179
214
  ## 完了条件
180
215
 
181
- - [ ] ドキュメントから全ての検証可能な主張を抽出
216
+ - [ ] セクション単位で主張を抽出し、各セクションの件数を記録
217
+ - [ ] `verifiableClaimCount >= 20`(未達の場合、カバレッジの低いセクションから再抽出)
182
218
  - [ ] 各主張について複数ソースからevidenceを収集
183
219
  - [ ] 各主張を分類(match/drift/gap/conflict)
184
- - [ ] コード内の未ドキュメント機能を特定
220
+ - [ ] 逆方向カバレッジを実施: ルートをGrepで列挙、テストファイルをGlobで列挙、エクスポートをGrepで列挙
221
+ - [ ] 逆方向カバレッジから未ドキュメント機能を特定
185
222
  - [ ] 未実装仕様を特定
186
223
  - [ ] 整合性スコアを計算
187
- - [ ] 指定フォーマットで出力
224
+ - [ ] 最終レスポンスがJSONであること
188
225
 
189
226
  ## 出力セルフチェック
190
227
 
191
- - [ ] 全ての所見が検証証拠に基づいている(修正提案をしていない)
228
+ - [ ] すべての存在主張(ファイル、テスト、関数の存在)がGlob/Grepのツール結果で裏付けられている
229
+ - [ ] すべての振る舞い主張が関数実装のReadで裏付けられている
230
+ - [ ] 識別子の照合にコード内の正確な文字列を使用している(修正を加えていない)
192
231
  - [ ] 各分類が複数ソースを引用している(単一ソースでない)
193
232
  - [ ] 低信頼度の分類が明示的に注記されている
194
233
  - [ ] 矛盾する証拠が無視されず文書化されている
234
+ - [ ] `reverseCoverage`セクションにツール結果に基づく実数値が入力されている
@@ -13,6 +13,11 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
13
13
 
14
14
  **タスク登録**: TaskCreateで作業ステップを登録。必ず最初に「スキル制約の確認」、最後に「スキル忠実度の検証」を含める。各完了時にTaskUpdateで更新。
15
15
 
16
+ ### 実装への反映
17
+ - documentation-criteriaスキルでドキュメント基準(Design Docの構造と必須要素を理解するため)を適用
18
+ - project-contextスキルでプロジェクトコンテキスト(用語と概念を理解するため)を適用
19
+ - typescript-rulesスキルで型定義の整合性チェックを適用
20
+
16
21
  ## 検出基準(唯一の判定ルール)
17
22
 
18
23
  **検出対象**: 基準ファイルに明示的記載がある項目で、他ファイルと値が異なる場合
@@ -112,13 +112,15 @@ DesignDocの場合、追加で以下を確認:
112
112
  - [ ] prior_context_count > 0の場合: 各項目に解決ステータスあり
113
113
  - [ ] prior_context_count > 0の場合: `prior_context_check`オブジェクト準備済み
114
114
  - [ ] 出力が有効なJSON
115
+ - [ ] 最終レスポンスがJSONであること
115
116
 
116
117
  全項目を完了してから出力へ進む。
117
118
 
118
- ### ステップ6: レビュー結果の報告
119
- - 観点に応じたJSON形式で結果を出力
119
+ ### ステップ6: JSON結果の返却
120
+ - レビューモード(総合的または観点別)に応じたJSONスキーマを使用
120
121
  - 問題の重要度を明確に分類
121
122
  - prior_context_count > 0の場合は`prior_context_check`オブジェクトを含める
123
+ - 最終レスポンスとしてJSONを返却する。スキーマは出力フォーマットを参照。
122
124
 
123
125
  ## 出力フォーマット
124
126
 
@@ -13,6 +13,10 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
13
13
 
14
14
  **タスク登録**: TaskCreateで作業ステップを登録。必ず最初に「スキル制約の確認」、最後に「スキル忠実度の検証」を含める。各完了時にTaskUpdateで更新。
15
15
 
16
+ ### 実装への反映
17
+ - integration-e2e-testingスキルで統合/E2Eテストのレビュー基準を適用(最重要)
18
+ - typescript-testingスキルでテスト品質基準、AAA構造、モック規約を適用
19
+
16
20
  ## 必要情報
17
21
 
18
22
  - **testFile**: レビュー対象のテストファイルパス(必須)
@@ -70,6 +74,9 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
70
74
  | 内部コンポーネント | 実物使用 | 不要なモック化 |
71
75
  | ログ出力検証 | vi.fn()使用 | 検証なしのモック |
72
76
 
77
+ ### 4. JSON結果の返却
78
+ 最終レスポンスとしてJSONを返却する。スキーマは出力フォーマットを参照。
79
+
73
80
  ## 出力フォーマット
74
81
 
75
82
  ### 構造化レスポンス
@@ -190,3 +197,10 @@ needs_revision判定時、後続処理で使用できる修正指示を出力:
190
197
  - `@dependency: full-system`の場合、モック使用は不合格
191
198
  - 全コンポーネント実装完了後に実行されているか確認
192
199
  - クリティカルユーザージャーニーの網羅性を検証
200
+
201
+ ## 完了条件
202
+
203
+ - [ ] すべてのスケルトンコメントを実装と照合
204
+ - [ ] 実装品質を評価
205
+ - [ ] Mock境界を検証(統合テスト)
206
+ - [ ] 最終レスポンスがJSONであること