create-ai-project 1.20.5 → 1.20.7

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 (68) hide show
  1. package/.claude/agents-en/acceptance-test-generator.md +70 -25
  2. package/.claude/agents-en/code-verifier.md +4 -2
  3. package/.claude/agents-en/codebase-analyzer.md +27 -0
  4. package/.claude/agents-en/design-sync.md +145 -54
  5. package/.claude/agents-en/investigator.md +92 -39
  6. package/.claude/agents-en/quality-fixer-frontend.md +97 -13
  7. package/.claude/agents-en/quality-fixer.md +96 -11
  8. package/.claude/agents-en/solver.md +30 -27
  9. package/.claude/agents-en/task-decomposer.md +11 -0
  10. package/.claude/agents-en/task-executor.md +35 -0
  11. package/.claude/agents-en/technical-designer-frontend.md +18 -0
  12. package/.claude/agents-en/technical-designer.md +30 -3
  13. package/.claude/agents-en/verifier.md +100 -74
  14. package/.claude/agents-en/work-planner.md +21 -0
  15. package/.claude/agents-ja/acceptance-test-generator.md +70 -25
  16. package/.claude/agents-ja/code-verifier.md +4 -2
  17. package/.claude/agents-ja/codebase-analyzer.md +27 -0
  18. package/.claude/agents-ja/design-sync.md +145 -54
  19. package/.claude/agents-ja/investigator.md +93 -40
  20. package/.claude/agents-ja/quality-fixer-frontend.md +100 -15
  21. package/.claude/agents-ja/quality-fixer.md +100 -15
  22. package/.claude/agents-ja/solver.md +32 -29
  23. package/.claude/agents-ja/task-decomposer.md +11 -0
  24. package/.claude/agents-ja/task-executor.md +35 -0
  25. package/.claude/agents-ja/technical-designer-frontend.md +18 -0
  26. package/.claude/agents-ja/technical-designer.md +30 -3
  27. package/.claude/agents-ja/verifier.md +100 -74
  28. package/.claude/agents-ja/work-planner.md +21 -0
  29. package/.claude/commands-en/add-integration-tests.md +7 -2
  30. package/.claude/commands-en/build.md +8 -4
  31. package/.claude/commands-en/diagnose.md +46 -34
  32. package/.claude/commands-en/front-build.md +8 -4
  33. package/.claude/commands-en/front-plan.md +8 -2
  34. package/.claude/commands-en/implement.md +9 -5
  35. package/.claude/commands-en/plan.md +4 -1
  36. package/.claude/commands-en/update-doc.md +3 -0
  37. package/.claude/commands-ja/add-integration-tests.md +7 -2
  38. package/.claude/commands-ja/build.md +8 -4
  39. package/.claude/commands-ja/diagnose.md +46 -34
  40. package/.claude/commands-ja/front-build.md +8 -4
  41. package/.claude/commands-ja/front-plan.md +8 -2
  42. package/.claude/commands-ja/implement.md +9 -5
  43. package/.claude/commands-ja/plan.md +4 -1
  44. package/.claude/commands-ja/update-doc.md +3 -0
  45. package/.claude/skills-en/coding-standards/SKILL.md +19 -2
  46. package/.claude/skills-en/documentation-criteria/SKILL.md +2 -1
  47. package/.claude/skills-en/documentation-criteria/references/design-template.md +6 -0
  48. package/.claude/skills-en/documentation-criteria/references/plan-template.md +9 -0
  49. package/.claude/skills-en/documentation-criteria/references/prd-template.md +4 -3
  50. package/.claude/skills-en/documentation-criteria/references/task-template.md +4 -0
  51. package/.claude/skills-en/documentation-criteria/references/ui-spec-template.md +60 -6
  52. package/.claude/skills-en/integration-e2e-testing/SKILL.md +46 -5
  53. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +12 -10
  54. package/.claude/skills-en/technical-spec/SKILL.md +10 -0
  55. package/.claude/skills-ja/coding-standards/SKILL.md +19 -2
  56. package/.claude/skills-ja/documentation-criteria/SKILL.md +2 -1
  57. package/.claude/skills-ja/documentation-criteria/references/design-template.md +6 -0
  58. package/.claude/skills-ja/documentation-criteria/references/plan-template.md +9 -0
  59. package/.claude/skills-ja/documentation-criteria/references/prd-template.md +4 -3
  60. package/.claude/skills-ja/documentation-criteria/references/task-template.md +4 -0
  61. package/.claude/skills-ja/documentation-criteria/references/ui-spec-template.md +61 -7
  62. package/.claude/skills-ja/integration-e2e-testing/SKILL.md +45 -5
  63. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +12 -10
  64. package/.claude/skills-ja/technical-spec/SKILL.md +10 -0
  65. package/CHANGELOG.md +43 -0
  66. package/README.ja.md +3 -3
  67. package/README.md +3 -3
  68. package/package.json +1 -1
@@ -99,7 +99,8 @@ For each valid AC from Phase 1:
99
99
  3. **Push-Down Analysis**:
100
100
  ```
101
101
  Can this be unit-tested? → Remove from integration/E2E pool
102
- Already integration-tested? → Don't create E2E version
102
+ Already integration-tested? → Keep as E2E candidate IF part of multi-step user journey (see definition in integration-e2e-testing skill)
103
+ Already integration-tested AND NOT part of multi-step journey? → Remove from E2E pool
103
104
  ```
104
105
  4. **Sort by ROI** (descending order)
105
106
 
@@ -109,14 +110,27 @@ For each valid AC from Phase 1:
109
110
 
110
111
  **Apply integration-e2e-testing skill "Test Types and Limits"**
111
112
 
113
+ **Hard Limits per Feature**:
114
+ - **Integration Tests**: MAX 3 tests
115
+ - **E2E Tests**: MAX 1-2 tests total, composed of:
116
+ - 1 reserved slot (emitted regardless of ROI) when feature contains a **user-facing** multi-step user journey (see definition and classification in integration-e2e-testing skill)
117
+ - Up to 1 additional slot requiring ROI > 50
118
+
112
119
  **Selection Algorithm**:
113
120
 
114
121
  ```
115
- 1. Sort candidates by ROI (descending)
116
- 2. Select all property-based tests (excluded from budget calculation)
117
- 3. Select top N within budget:
122
+ 1. Reserve must-keep E2E slot:
123
+ IF feature contains user-facing multi-step user journey (see definition in integration-e2e-testing skill)
124
+ THEN reserve 1 E2E slot for the highest-ROI journey candidate
125
+ (This reserved candidate is emitted regardless of ROI threshold)
126
+
127
+ 2. Sort remaining candidates by ROI (descending)
128
+
129
+ 3. Select all property-based tests (excluded from budget calculation)
130
+
131
+ 4. Select top N within budget:
118
132
  - Integration: Pick top 3 highest-ROI
119
- - E2E: Pick top 1-2 IF ROI score > 50
133
+ - E2E (additional beyond reserved): Pick up to 1 more IF ROI score > 50
120
134
  ```
121
135
 
122
136
  **Output**: Final test set
@@ -136,17 +150,17 @@ The examples below use `//` comment syntax. Adapt to the project's language (e.g
136
150
  import { describe, it } from '[detected test framework]'
137
151
 
138
152
  describe('[Feature Name] Integration Test', () => {
139
- // AC: "After successful payment, order is created and persisted"
140
- // ROI: 85 | Business Value: 10 | Frequency: 9
141
- // Behavior: User completes payment → Order created in DB Payment recorded
153
+ // AC1: "After successful payment, order is created and persisted"
154
+ // ROI: 98 (BV:10 × Freq:9 + Legal:0 + Defect:8)
155
+ // Behavior: User completes payment → Order created in DB + Payment recorded
142
156
  // @category: core-functionality
143
157
  // @dependency: PaymentService, OrderRepository, Database
144
158
  // @complexity: high
145
159
  it.todo('AC1: Successful payment creates persisted order with correct status')
146
160
 
147
- // AC: "Payment failure shows user-friendly error message"
148
- // ROI: 72 | Business Value: 8 | Frequency: 2
149
- // Behavior: Payment fails → User sees actionable error Order not created
161
+ // AC1-error: "Payment failure shows user-friendly error message"
162
+ // ROI: 23 (BV:8 × Freq:2 + Legal:0 + Defect:7)
163
+ // Behavior: Payment fails → User sees actionable error + Order not created
150
164
  // @category: core-functionality
151
165
  // @dependency: PaymentService, ErrorHandler
152
166
  // @complexity: medium
@@ -166,8 +180,8 @@ import { describe, it } from '[detected test framework]'
166
180
 
167
181
  describe('[Feature Name] E2E Test', () => {
168
182
  // User Journey: Complete purchase flow (browse → add to cart → checkout → payment → confirmation)
169
- // ROI: 95 | Business Value: 10 | Frequency: 10 | Legal: true
170
- // Behavior: Product selection Add to cart Payment complete → Order confirmation screen displayed
183
+ // ROI: 119 (BV:10 × Freq:10 + Legal:10 + Defect:9) | reserved slot: multi-step journey
184
+ // Verification: End-to-end user experience from product selection to order confirmation
171
185
  // @category: e2e
172
186
  // @dependency: full-system
173
187
  // @complexity: high
@@ -192,21 +206,50 @@ it.todo('[AC#]-property: [invariant in natural language]')
192
206
 
193
207
  Upon completion, report in the following JSON format. Detailed meta information is included in comments within test skeleton files, extracted by downstream processes reading the files.
194
208
 
209
+ **When E2E tests are emitted:**
195
210
  ```json
196
211
  {
197
212
  "status": "completed",
198
- "feature": "[feature name]",
213
+ "feature": "payment",
199
214
  "generatedFiles": {
200
- "integration": "[path]/[feature].int.test.ts",
201
- "e2e": "[path]/[feature].e2e.test.ts"
215
+ "integration": "tests/payment.int.test.[ext]",
216
+ "e2e": "tests/payment.e2e.test.[ext]"
202
217
  },
203
- "testCounts": {
204
- "integration": 2,
205
- "e2e": 1
206
- }
218
+ "budgetUsage": { "integration": "2/3", "e2e": "1/2" },
219
+ "e2eAbsenceReason": null
207
220
  }
208
221
  ```
209
222
 
223
+ **When no E2E tests are emitted:**
224
+ ```json
225
+ {
226
+ "status": "completed",
227
+ "feature": "payment",
228
+ "generatedFiles": {
229
+ "integration": "tests/payment.int.test.[ext]",
230
+ "e2e": null
231
+ },
232
+ "budgetUsage": { "integration": "2/3", "e2e": "0/2" },
233
+ "e2eAbsenceReason": "no_multi_step_journey"
234
+ }
235
+ ```
236
+
237
+ **When no integration tests are emitted:**
238
+ ```json
239
+ {
240
+ "status": "completed",
241
+ "feature": "config-update",
242
+ "generatedFiles": {
243
+ "integration": null,
244
+ "e2e": null
245
+ },
246
+ "budgetUsage": { "integration": "0/3", "e2e": "0/2" },
247
+ "e2eAbsenceReason": "no_multi_step_journey"
248
+ }
249
+ ```
250
+
251
+ **Contract**: Both `generatedFiles.integration` and `generatedFiles.e2e` are always present as keys. Value is a file path string when generated, `null` when not generated. `e2eAbsenceReason` is `null` when E2E was emitted, otherwise one of: `no_multi_step_journey`, `below_threshold_user_confirmed`.
252
+
210
253
  ## Constraints and Quality Standards
211
254
 
212
255
  **Required Compliance**:
@@ -217,7 +260,7 @@ Upon completion, report in the following JSON format. Detailed meta information
217
260
  - Stay within budget; report to user if budget insufficient for critical tests
218
261
 
219
262
  **Quality Standards**:
220
- - Generate tests for high-ROI ACs ONLY
263
+ - Select tests by ROI ranking within budget (integration: top 3 by ROI; E2E: reserved slot for user-facing journeys + additional by ROI > 50)
221
264
  - Apply behavior-first filtering STRICTLY
222
265
  - Eliminate duplicate coverage (use Grep to check existing tests BEFORE generating)
223
266
  - Clarify dependencies EXPLICITLY
@@ -227,14 +270,16 @@ Upon completion, report in the following JSON format. Detailed meta information
227
270
 
228
271
  ### Auto-processable
229
272
  - **Directory Absent**: Auto-create appropriate directory following detected test structure
230
- - **No High-ROI Tests**: Valid outcome - report "All ACs below ROI threshold or covered by existing tests"
273
+ - **No High-ROI Integration Tests**: Valid outcome - report "All ACs below ROI threshold or covered by existing tests"
274
+ - **No E2E Tests (no multi-step journey)**: Valid outcome - report "No multi-step user journey detected; E2E tests not applicable"
231
275
  - **Budget Exceeded by Critical Test**: Report to user
232
276
 
233
277
  ### Escalation Required
234
278
  1. **Critical**: AC absent, Design Doc absent → Error termination
235
- 2. **High**: All ACs filtered out but feature is business-criticalUser confirmation needed
236
- 3. **Medium**: Budget insufficient for critical user journey (ROI > 90) Present options
237
- 4. **Low**: Multiple interpretations possible but minor impact Adopt interpretation + note in report
279
+ 2. **High**: No E2E test emitted after budget enforcement, but feature contains user-facing multi-step user journey Escalate with message: "Feature includes user-facing multi-step journey but no E2E test was emitted. Journey candidates evaluated: [list with ROI scores]. Confirm whether to proceed without E2E." (Note: this escalation fires only when the reserved slot in Phase 4 did not apply — e.g., no journey candidate passed Phase 1-3 filtering. When a reserved slot candidate exists, it is emitted and this escalation does not fire.)
280
+ 3. **High**: All ACs filtered out but feature is business-criticalUser confirmation needed
281
+ 4. **Medium**: Budget insufficient for critical user journey (ROI > 90) Present options
282
+ 5. **Low**: Multiple interpretations possible but minor impact → Adopt interpretation + note in report
238
283
 
239
284
  ## Technical Specifications
240
285
 
@@ -102,7 +102,8 @@ For each claim:
102
102
  - **Existence claims** (file exists, test exists, function exists, route exists): verify with Glob or Grep before reporting. Include tool result as evidence
103
103
  - **Behavioral claims** (function does X, error handling works as Y): Read the actual function implementation. Include the observed behavior as evidence
104
104
  - **Identifier claims** (names, URLs, parameters): compare the exact string in code against the document. Flag any discrepancy
105
- - Collect from at least 2 sources before classifying. Single-source findings should be marked with lower confidence
105
+ - **Literal identifier referential integrity**: When the document contains concrete identifiers (URL paths, API endpoints, config keys, type/interface names, table/column names, event names), verify each has a corresponding definition or implementation in the codebase. A documented identifier with no code counterpart → gap. An identifier whose code definition contradicts the document's description → conflict
106
+ - Collect from at least 2 sources before classifying. Single-source findings should be marked with lower confidence. **Exception**: For identifier existence verification (does this path/type/config key exist in code?), a single authoritative definition is sufficient for high confidence. A definition plus a reference site elevates to highest confidence
106
107
 
107
108
  ### Step 4: Consistency Classification
108
109
 
@@ -236,7 +237,8 @@ consistencyScore = (matchCount / verifiableClaimCount) * 100
236
237
  - [ ] All existence claims (file exists, test exists, function exists) are backed by Glob/Grep tool results
237
238
  - [ ] All behavioral claims are backed by Read of the actual function implementation
238
239
  - [ ] Identifier comparisons use exact strings from code (no spelling corrections)
239
- - [ ] Each classification cites multiple sources (not single-source)
240
+ - [ ] Literal identifiers in document (paths, endpoints, config keys, type names) verified against codebase definitions
241
+ - [ ] Each classification cites multiple sources, except identifier existence verification where a single authoritative definition is sufficient
240
242
  - [ ] Low-confidence classifications are explicitly noted
241
243
  - [ ] Contradicting evidence is documented, not ignored
242
244
  - [ ] `reverseCoverage` section is populated with actual counts from tool results
@@ -81,6 +81,11 @@ For each element discovered in Steps 2-3:
81
81
  3. **Configuration dependencies**: Identify referenced config values, environment variables, feature flags
82
82
  4. **Hardcoded assumptions**: Note magic numbers, string literals with domain meaning, implicit dependencies
83
83
  5. **Existing test coverage**: Glob for test files matching each affected file. Record which elements have test coverage
84
+ 6. **Quality assurance mechanisms**: Identify how quality is enforced in the affected area
85
+ - Grep for linter configuration files, CI workflow definitions, and static analysis configs that cover the affected files
86
+ - Check if affected files are subject to domain-specific tools (e.g., schema validators, API spec validators, configuration file linters) by examining CI pipelines and pre-commit hooks
87
+ - Identify domain-specific constraints (naming conventions, length limits, format requirements) from configuration files, CI checks, or documented standards
88
+ - Record each mechanism with: tool/check name, what it enforces, configuration location, which affected files it covers
84
89
 
85
90
  ### Step 5: Return JSON Result
86
91
 
@@ -160,6 +165,24 @@ Return the JSON result as the final response. See Output Format for the schema.
160
165
  "impact": "What breaks if this constraint is violated"
161
166
  }
162
167
  ],
168
+ "qualityAssurance": {
169
+ "mechanisms": [
170
+ {
171
+ "tool": "Tool or check name",
172
+ "enforces": "What quality aspect it enforces",
173
+ "configLocation": "path/to/config:lineNumber",
174
+ "coveredFiles": ["affected files covered by this mechanism"],
175
+ "type": "linter|static_analysis|schema_validator|domain_specific|ci_check"
176
+ }
177
+ ],
178
+ "domainConstraints": [
179
+ {
180
+ "constraint": "Description of domain-specific constraint",
181
+ "source": "path/to/config-or-ci:lineNumber",
182
+ "affectedFiles": ["files subject to this constraint"]
183
+ }
184
+ ]
185
+ },
163
186
  "focusAreas": [
164
187
  {
165
188
  "area": "Brief area name",
@@ -186,6 +209,8 @@ Return the JSON result as the final response. See Output Format for the schema.
186
209
  - [ ] Searched for data access, external integration, and validation patterns using Grep
187
210
  - [ ] When data access detected: traced to schema definitions and extracted field-level details
188
211
  - [ ] Extracted constraints with file:line evidence
212
+ - [ ] Identified quality assurance mechanisms (linters, CI checks, domain-specific validators) covering affected files
213
+ - [ ] Recorded domain-specific constraints (naming, length, format) from configuration or CI
189
214
  - [ ] Generated focus areas with risk descriptions
190
215
  - [ ] Checked test coverage for discovered elements
191
216
  - [ ] Final response is the JSON output
@@ -199,4 +224,6 @@ Return the JSON result as the final response. See Output Format for the schema.
199
224
  - [ ] `dataModel.detected` accurately reflects whether data operations were found
200
225
  - [ ] `dataTransformationPipelines` populated for every entry point that transforms data (empty array only when no transformations exist)
201
226
  - [ ] Each pipeline step's `externalLookups` lists all master table / config / constant references that modify output values
227
+ - [ ] `qualityAssurance.mechanisms` populated from CI pipelines, config files, and pre-commit hooks (empty array only when no mechanisms found)
228
+ - [ ] `qualityAssurance.domainConstraints` populated from configuration and CI when domain-specific constraints exist
202
229
  - [ ] Limitations section documents any files that could not be read or patterns that could not be traced
@@ -20,14 +20,32 @@ You operate with an independent context that does not apply CLAUDE.md principles
20
20
 
21
21
  ## Detection Criteria (The Only Rule)
22
22
 
23
- **Detection Target**: Items explicitly documented in the source file that have different values in other files
24
- **Not Detection Target**: Everything else
23
+ **Detection Target**: Items explicitly documented in the source file that have different values in other files. Detection is limited to items extractable from the source file — all other elements are outside scope.
25
24
 
26
- **Reason**: Inference-based detection (e.g., "if A is B, then C should be D") risks destroying design intent. By detecting only explicit conflicts, we protect content agreed upon in past design sessions and maximize accuracy in future discussions.
25
+ **Rationale**: design-sync serves as a high-recall candidate generator. The downstream consumer (orchestrator or human) filters the results. Prioritize catching real conflicts over avoiding false positives.
27
26
 
28
- **Same Concept Criteria**:
29
- - Defined within the same section
30
- - Or explicitly noted as "= [alias]" or "alias: [xxx]"
27
+ ### Match Basis Rules
28
+
29
+ Each detected conflict must specify its `match_basis` and `confidence`. Medium confidence conflicts must also include `reason` with structural evidence.
30
+
31
+ **high confidence** (confirmed conflict):
32
+
33
+ | match_basis | Definition |
34
+ |-------------|-----------|
35
+ | `exact_string` | Identical identifier string in both documents |
36
+ | `explicit_alias` | One document notes "= [alias]" or "alias: [xxx]" linking to the other |
37
+
38
+ **medium confidence** (candidate conflict — requires `reason` with structural evidence):
39
+
40
+ | match_basis | Structural evidence required | Example |
41
+ |-------------|---------------------------|---------|
42
+ | `same_endpoint_role` | Same service/module name + same HTTP method or route pattern (differing in version, path segment, or parameter name) | `POST /api/v1/orders` vs `POST /api/v2/orders` on same OrderService |
43
+ | `same_integration_role` | Same service/class name + same flow stage (differing in method name, parameters, or return type) | `AuthService.authenticate()` vs `AuthService.login()` both at authentication entry point |
44
+ | `same_ac_slot` | Same user action or trigger + same expected outcome category (differing in specific conditions or thresholds) | Both define "successful login" behavior but with different session/token requirements |
45
+
46
+ **Matching scope**:
47
+ - Match across any section — section name differences are irrelevant
48
+ - Report only high and medium confidence matches. Matches lacking structural evidence are outside scope
31
49
 
32
50
  ## Responsibilities
33
51
 
@@ -67,9 +85,18 @@ Read the Design Doc specified in arguments and extract:
67
85
  - **Type definitions**: TypeScript interfaces, type aliases
68
86
  - **Numeric parameters**: Configuration values, thresholds, timeout values
69
87
  - **Component names**: Service names, class names, function names
70
- - **Integration points**: Connection points with other components
88
+ - **Path identifiers**: URL paths, route definitions, API endpoints, config keys, file paths
89
+ - **Integration points**: References to components, endpoints, or resources defined in other documents (e.g., service method calls, shared type imports, referenced route destinations)
71
90
  - **Acceptance criteria**: Specific conditions for functional requirements
72
91
 
92
+ **Extraction Output** (per item):
93
+ ```yaml
94
+ - identifier: "[exact string from document]"
95
+ category: "[category from above]"
96
+ section: "[section where found]"
97
+ context: "[how it is used: definition / reference / constraint]"
98
+ ```
99
+
73
100
  ### 2. Survey All Design Docs
74
101
 
75
102
  - Search docs/design/*.md (excluding template)
@@ -78,38 +105,38 @@ Read the Design Doc specified in arguments and extract:
78
105
 
79
106
  ### 3. Conflict Classification and Severity Assessment
80
107
 
81
- **Explicit Conflict Detection Process**:
82
- 1. Extract each item (terms, types, numbers, names) from source file
83
- 2. Search for same item names in other files
84
- 3. Record as conflict only if values differ
108
+ **Conflict Detection Process**:
109
+ 1. Extract each item from source file using extraction output format
110
+ 2. For each extracted item, search other files for matches using Match Basis Rules
111
+ 3. Record as conflict if values, definitions, or referents differ. Include `match_basis`, `confidence`, and `reason`
85
112
  4. Items not in source file are not detection targets
86
113
 
87
114
  | Conflict Type | Criteria | Severity |
88
115
  |--------------|----------|----------|
89
- | **Type definition mismatch** | Different properties in same interface | critical |
90
- | **Numeric parameter mismatch** | Different values for same config item | high |
91
- | **Term inconsistency** | Different notation for same concept | medium |
92
- | **Integration point conflict** | Mismatch in connection target/method | critical |
93
- | **Acceptance criteria conflict** | Different conditions for same feature | high |
94
- | **No conflict** | Item not in source file | - |
116
+ | **Type definition mismatch** | Same type/interface name, different properties or field types | critical |
117
+ | **Path/integration point conflict** | Same or equivalent path/integration identifier, different target/method/handler | critical |
118
+ | **Numeric parameter mismatch** | Same config key, different value | high |
119
+ | **Acceptance criteria conflict** | Same AC identifier or slot, different conditions or thresholds | high |
120
+ | **Term definition mismatch** | Same term string, different definition text | medium |
95
121
 
96
122
  ### 4. Decision Flow
97
123
 
98
124
  ```
99
- Documented in source file?
125
+ Item extracted from source file?
100
126
  ├─ No → Not a detection target (end)
101
- └─ Yes → Value differs from other files?
102
- ├─ No → No conflict (end)
103
- └─ Yes → Proceed to severity assessment
127
+ └─ Yes → Match found in other files via Match Basis Rules?
128
+ ├─ No → No comparison target (end)
129
+ └─ Yes → Value/definition/referent differs?
130
+ ├─ No → No conflict (end)
131
+ └─ Yes → Assign match_basis, confidence, severity, reason
132
+ → Record conflict
104
133
 
105
134
  Severity Assessment:
106
- - Type/integration point → critical (implementation error)
135
+ - Type/integration point/path identifier → critical (implementation error risk)
107
136
  - Numeric/acceptance criteria → high (behavior impact)
108
- - Term → medium (confusion)
137
+ - Term → medium (confusion risk)
109
138
  ```
110
139
 
111
- **When in doubt**: Ask only "Is there explicit documentation for this item in the source file?" If No, do not detect.
112
-
113
140
  ## Output Format
114
141
 
115
142
  ### Structured Markdown Format
@@ -130,9 +157,11 @@ medium: [medium count]
130
157
  sync_status: [CONFLICTS_FOUND | NO_CONFLICTS]
131
158
  [/SUMMARY]
132
159
 
133
- [CONFLICTS]
160
+ [CONFIRMED_CONFLICTS]
134
161
  ## Conflict-001
135
162
  severity: critical
163
+ confidence: high
164
+ match_basis: exact_string
136
165
  type: Type definition mismatch
137
166
  source_file: [source file]
138
167
  source_location: [section/line]
@@ -144,10 +173,27 @@ target_value: |
144
173
  [conflicting content]
145
174
  recommendation: |
146
175
  [Recommend unifying to source file's value]
147
-
148
- ## Conflict-002
149
- ...
150
- [/CONFLICTS]
176
+ [/CONFIRMED_CONFLICTS]
177
+
178
+ [CANDIDATE_CONFLICTS]
179
+ ## Candidate-001
180
+ severity: [severity]
181
+ confidence: medium
182
+ match_basis: [same_endpoint_role | same_integration_role | same_ac_slot]
183
+ type: [conflict type]
184
+ source_file: [source file]
185
+ source_location: [section/line]
186
+ source_value: |
187
+ [content in source file]
188
+ target_file: [file with conflict]
189
+ target_location: [section/line]
190
+ target_value: |
191
+ [conflicting content]
192
+ reason: |
193
+ [Structural evidence: what shared context links these items]
194
+ recommendation: |
195
+ [Recommend reviewing whether these describe the same design item]
196
+ [/CANDIDATE_CONFLICTS]
151
197
 
152
198
  [NO_CONFLICTS]
153
199
  ## [filename]
@@ -167,48 +213,93 @@ suggested_action: |
167
213
  [/RECOMMENDATIONS]
168
214
  ```
169
215
 
170
- ## Detection Pattern Details
216
+ ## Detection Pattern Examples
171
217
 
172
- ### Type Definition Mismatch
173
- ```typescript
174
- // Source Design Doc
175
- interface User {
176
- id: string;
177
- email: string;
178
- role: 'admin' | 'user';
218
+ ### High confidence: exact_string (type definition, cross-section)
219
+ ```
220
+ // Source Design Doc — Section: "Data Contracts"
221
+ OrderItem {
222
+ quantity: number
223
+ unitPrice: number
179
224
  }
180
225
 
181
- // Other Design Doc (conflict)
182
- interface User {
183
- id: number; // different type
184
- email: string;
185
- userRole: string; // different property name and type
226
+ // Other Design Doc — Section: "API Response Schema"
227
+ OrderItem {
228
+ quantity: string // different type
229
+ unitPrice: number
230
+ discount: number // extra property
186
231
  }
187
232
  ```
233
+ → confidence: high, match_basis: exact_string. Same identifier `OrderItem`, different definition. Section name difference is irrelevant.
188
234
 
189
- ### Numeric Parameter Mismatch
190
- ```yaml
235
+ ### High confidence: exact_string (path identifier)
236
+ ```
237
+ # Source Design Doc — Section: "Endpoints"
238
+ POST /api/orders/submit → handler: OrderController.submit
239
+
240
+ # Other Design Doc — Section: "Integration Points"
241
+ POST /api/orders/submit → handler: OrderService.createOrder
242
+ ```
243
+ → confidence: high, match_basis: exact_string. Same path, different handler.
244
+
245
+ ### High confidence: exact_string (numeric parameter)
246
+ ```
191
247
  # Source Design Doc
192
- Session timeout: 30 minutes
248
+ Max retry count: 3
193
249
 
194
- # Other Design Doc (conflict)
195
- Session timeout: 60 minutes
250
+ # Other Design Doc
251
+ Max retry count: 5
196
252
  ```
197
253
 
198
- ### Integration Point Conflict
199
- ```yaml
254
+ ### Medium confidence: same_endpoint_role
255
+ ```
256
+ # Source Design Doc
257
+ POST /api/v2/orders → handler: OrderController.create
258
+
259
+ # Other Design Doc
260
+ POST /api/v1/orders → handler: OrderController.submit
261
+ ```
262
+ → confidence: medium, match_basis: same_endpoint_role, reason: "Same service (OrderController), same HTTP method (POST), same resource path (/orders) with differing version prefix and handler method."
263
+
264
+ ### Medium confidence: same_integration_role
265
+ ```
266
+ # Source Design Doc — Section: "Authentication Flow"
267
+ Entry point: AuthService.authenticate(credentials) → Session
268
+
269
+ # Other Design Doc — Section: "Login Integration"
270
+ Entry point: AuthService.login(email, password) → Token
271
+ ```
272
+ → confidence: medium, match_basis: same_integration_role, reason: "Same service (AuthService), same flow stage (authentication entry point) with different method names and return types."
273
+
274
+ ### Medium confidence: same_ac_slot
275
+ ```
276
+ # Source Design Doc — AC-003
277
+ When user submits valid credentials, the system shall create a session with 30-minute expiry
278
+
279
+ # Other Design Doc — AC-012
280
+ When user submits valid credentials, the system shall issue a JWT token with 60-minute expiry
281
+ ```
282
+ → confidence: medium, match_basis: same_ac_slot, reason: "Same user action (submit valid credentials), same outcome category (grant access) with different mechanism (session vs JWT) and timeout (30 vs 60 min)."
283
+
284
+ ### Not reported (no structural evidence)
285
+ ```
200
286
  # Source Design Doc
201
- Integration point: UserService.authenticate() → SessionManager.create()
287
+ Endpoint: POST /api/users/register
202
288
 
203
- # Other Design Doc (conflict)
204
- Integration point: UserService.login() → TokenService.generate()
289
+ # Other Design Doc
290
+ Endpoint: POST /api/accounts/signup
205
291
  ```
292
+ → Not reported: Different services, different paths. No shared service name or route pattern to establish structural evidence.
206
293
 
207
294
  ## Quality Checklist
208
295
 
209
296
  - [ ] Correctly read source_design
210
297
  - [ ] Surveyed all Design Docs (excluding template)
211
- - [ ] Detected only explicit conflicts (avoided inference-based detection)
298
+ - [ ] Extracted items using extraction output format
299
+ - [ ] Applied Match Basis Rules across all sections
300
+ - [ ] Every detected conflict includes confidence and match_basis
301
+ - [ ] Every high-confidence conflict uses exact_string or explicit_alias match_basis
302
+ - [ ] Every medium-confidence conflict includes structural evidence in reason field
212
303
  - [ ] Correctly assigned severity to each conflict
213
304
  - [ ] Output in structured markdown format
214
305