# type-collision-detector > Find duplicate type names within your solution (same name in different namespaces). Use before creating new types to avoid naming conflicts. Only checks your code, not external packages. (project, gitignored) - Author: Claude - Repository: psklarkins/claude-tools - Version: 20260108102420 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/psklarkins/claude-tools - Web: https://mule.run/skillshub/@@psklarkins/claude-tools~type-collision-detector:20260108102420 --- --- name: type-collision-detector description: Find duplicate type names within your solution (same name in different namespaces). Use before creating new types to avoid naming conflicts. Only checks your code, not external packages. (project, gitignored) --- # Type Collision Detector Skill This skill detects when you have multiple types with the same name in different namespaces within your own codebase. **Tool Location:** `C:\Users\Administrator\.claude\skills\type-collision-detector\type-collision-detector.exe` ## When to Use This Skill - **Before creating a new type** - "Will `Product` collide with anything?" - "Do I have any duplicate type names?" - "Are there multiple classes named `Result`?" - When experiencing ambiguous reference errors - During code review to catch naming issues - When merging branches that may have added similar types ## Commands ```bash # Run via claude-tools CLI claude-tools skill type-collision-detector # Or run executable directly C:\Users\Administrator\.claude\skills\type-collision-detector\type-collision-detector.exe ``` ## What This Skill Does 1. **Scans your solution** for all type definitions 2. **Groups types by name** (ignoring namespace) 3. **Identifies collisions** - Same type name in different namespaces 4. **Excludes external packages** - Only checks YOUR code 5. **Reports severity:** - **ERROR**: Exact same name, different namespaces - **WARNING**: Similar names (case differences, pluralization) ## Why This Matters ```csharp // File: src/Domain/Models/Product.cs namespace MyApp.Domain.Models { public class Product { } // Your domain entity } // File: src/API/DTOs/Product.cs namespace MyApp.API.DTOs { public class Product { } // Your DTO } // This causes problems: using MyApp.Domain.Models; using MyApp.API.DTOs; var product = new Product(); // ERROR: Ambiguous reference! ``` ## Output Format ``` === TYPE COLLISION REPORT === Status: ⚠ COLLISIONS FOUND ERRORS (Must Fix): ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. "Product" (2 definitions) ✗ MyApp.Domain.Models.Product File: src/Domain/Models/Product.cs:10 Type: class ✗ MyApp.API.DTOs.Product File: src/API/DTOs/Product.cs:8 Type: class SUGGESTION: Rename DTO to "ProductDto" or "ProductResponse" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SUMMARY: Total Types Scanned: 145 Collisions Found: 1 error Recommendation: Fix errors before creating new types ``` ## Workflow When this skill is invoked: 1. **Determine search scope**: which directory to scan 2. **Run the TypeCollisionDetector tool** 3. **Parse and present results** showing: - All colliding type names - Their locations and namespaces - Suggestions for resolution 4. **Recommend fixes** ## Common Collision Patterns **Domain Model vs DTO:** ```csharp Domain.Models.Product vs API.DTOs.Product → Suggest: ProductDto, ProductResponse ``` **Result types:** ```csharp Core.Result vs Services.ServiceResult vs API.ApiResult → Suggest: Use IGenericResult everywhere ``` ## Suggested Naming Conventions **To avoid collisions:** 1. **Suffix DTOs:** - `ProductDto` - `ProductRequest` - `ProductResponse` 2. **Suffix ViewModels:** - `ProductViewModel` 3. **Qualify by purpose:** - `ProductEntity` (domain) - `ProductModel` (API) 4. **Use generic interfaces once:** - Single `IRepository` instead of multiple `IRepository` ## Integration with Other Skills **Workflow before creating a new type:** ``` 1. type-collision-detector → Check if name exists 2. type-finder "MyNewType" → Verify it's unique 3. namespace-explorer → Check target namespace conventions 4. Create type following conventions 5. build → Verify no ambiguous references ``` **When collision found:** ``` 1. type-collision-detector → Find all definitions 2. refactor → Rename one or more types 3. build → Verify build succeeds 4. Run again to confirm collision resolved ``` ## Example Usage User asks: - "Check for type collisions" - "Can I name my new class `Result`?" - "Why am I getting 'ambiguous reference' errors?" Skill will: 1. Scan all .cs files in solution 2. Build type registry 3. Find duplicates 4. Generate report with suggestions ## Notes - Runs quickly (syntax-based, no compilation) - Can be run pre-commit (via git hook) - Language-aware (understands C# type syntax) - Ignores obj/ and bin/ directories - Handles partial classes correctly (same name OK if same namespace)