| name | type-finder |
| description | Search for C# types (classes, interfaces, records, structs, enums) by name or pattern across the solution. Use when you need to locate a specific type. (project, gitignored) |
Type Finder Skill
This skill searches for C# types (classes, interfaces, records, structs, enums) by name or regex pattern across your codebase.
Tool Location: D:\FractalDataworks\RoslynTools\src\RoslynTools.TypeFinder
When to Use This Skill
- When asked "where is class X?"
- When searching for types matching a pattern (e.g., "find all Services")
- Before implementing a new type (to check if it exists)
- When exploring unfamiliar codebases
- When user asks "find all interfaces" or "find all records"
- When planning where to add new functionality
What This Skill Does
- Searches for types by exact name or regex pattern
- Finds all type declarations: classes, interfaces, records, structs, enums
- Shows location: file path, namespace, line number
- Supports regex patterns for advanced searching
- Fast syntax-based search (no compilation required)
API Endpoint
POST /analysis/types/find
Request:
{
"pattern": ".*Service$",
"useRegex": true,
"typeKinds": ["class", "interface"],
"includeInternal": false
}
Response:
{
"isSuccess": true,
"data": {
"types": [
{
"name": "ProductService",
"kind": "class",
"namespace": "MyApp.Services",
"filePath": "D:\\MyProject\\src\\Services\\ProductService.cs",
"lineNumber": 15,
"accessibility": "public"
}
]
}
}
TypeKinds Options:
"class"- Classes"interface"- Interfaces"record"- Records"struct"- Structs"enum"- Enums
How It Works
1. Start the Server
dotnet run --project D:\FractalDataworks\RoslynTools\src\CyberdineDevelopment.RoslynTools.Server
2. Load Solution
using CyberdineDevelopment.RoslynTools.Client;
var client = new RoslynWorkspaceClient("http://localhost:5000");
await client.LoadSolution(@"D:\MyProject\MyProject.sln");
3. Find Types
// Simple search: Find "ProductService"
var result = await client.FindTypes(
pattern: "ProductService",
useRegex: false
);
// Regex search: Find all classes ending with "Service"
var result = await client.FindTypes(
pattern: ".*Service$",
useRegex: true,
typeKinds: new[] { "class" }
);
// Find all interfaces
var result = await client.FindTypes(
pattern: "^I[A-Z].*",
useRegex: true,
typeKinds: new[] { "interface" }
);
// Process results
if (result.IsSuccess)
{
foreach (var type in result.Data.Types)
{
Console.WriteLine($"{type.Kind}: {type.Name}");
Console.WriteLine($" File: {type.FilePath}:{type.LineNumber}");
Console.WriteLine($" Namespace: {type.Namespace}");
}
}
Example Usage
User asks:
"Where is the ProductService class?" → Use client.FindTypes("ProductService", useRegex: false)
"Find all classes ending with 'Repository'" → Use client.FindTypes(".*Repository$", useRegex: true, typeKinds: ["class"])
"Show me all interfaces in the project" → Use client.FindTypes("^I[A-Z]", useRegex: true, typeKinds: ["interface"])
"Find all services" → Use client.FindTypes("Service", useRegex: false)
Semantic Analysis Benefits
Using the Server API provides significant advantages:
- Full Type Information: Access to ISymbol data including accessibility, modifiers, base types
- Cross-Project Resolution: Find types across all projects in the solution
- Inheritance Analysis: Understand type hierarchies and interface implementations
- Accurate Accessibility: Know if type is public, internal, private, protected
- Generic Type Support: Properly handle generic types with constraints
- In-Memory Performance: Fast lookups without file system scans
Output Format
=== TYPE SEARCH RESULTS ===
Search: "Service"
Found: 3 types
Type: ProductService (Class)
File: D:\MyProject\src\Services\ProductService.cs:15
Namespace: MyApp.Services
Type: IProductService (Interface)
File: D:\MyProject\src\Abstractions\IProductService.cs:8
Namespace: MyApp.Abstractions
Type: CustomerService (Class)
File: D:\MyProject\src\Services\CustomerService.cs:12
Namespace: MyApp.Services
Common Patterns
Find all Services
dotnet run --project ... -- ./src Service
Find all Interfaces
dotnet run --project ... -- ./src "^I[A-Z]" --regex
Find all DTOs/Models
dotnet run --project ... -- ./src "(Dto|Model)$" --regex
Find all Controllers
dotnet run --project ... -- ./src Controller
Find exact type name
dotnet run --project ... -- ./src "^ProductService$" --regex
Workflow
When this skill is invoked:
- Ensure server is running (start if needed)
- Load solution into workspace if not already loaded
- Call FindTypes endpoint with search pattern and filters
- Parse and present results showing:
- Type name and kind (class, interface, record, etc.)
- File path and line number
- Namespace
- Accessibility level
- Base types and interfaces (if requested)
- Suggest next actions based on results
Integration with Other Skills
After finding types:
- Use
complexity-analyzerto analyze found classes - Use
doc-generatorto document found types - Use
type-collision-detectorto check for naming conflicts - Use
namespace-explorerto understand the structure
Notes
- Uses Roslyn Workspace API with semantic model
- Searches across entire solution loaded in workspace
- Fast in-memory lookups (no file system scans)
- Supports modern C# types: records, record structs, file-scoped namespaces
- Case-sensitive by default (use regex with (?i) for case-insensitive)
- Returns full symbol information including accessibility and inheritance
- Server maintains workspace state between searches
Follow-up Actions
After finding types, suggest:
- "Open
: to view the type" - "Analyze complexity of this class"
- "Generate documentation for this type"
- "Check for types with similar names using type-collision-detector"