Navigate and analyze C# codebases using Sharpitect's semantic tools. Use when searching for C# declarations, understanding inheritance, finding method callers/callees, or exploring code relationships in .NET projects.
This skill is limited to using the following tools:
Sharpitect provides semantic understanding of C# codebases through MCP tools. Always prefer Sharpitect MCP tools over text-based searching (Grep/Glob) when working with C# code.
Use Sharpitect tools as your first choice for:
Grep with pattern matchingsearch_declarations to find classes, interfaces, methods, properties by nameget_inheritance with direction: descendants (implementations) or ancestors (base types)Grep for method names (which may match strings, comments, etc.)get_callers to find what calls a method, or get_usages for all referencesget_callees to see all methods/properties a method usesGlob to list files and Read to understand structureget_tree to see containment hierarchy, get_children for membersget_dependencies (what a project references) or get_dependents (what depends on a project)Read to see actual implementation1. search_declarations(query="IGraphRepository", kind="interface")
2. get_inheritance(id="...", direction="descendants")
1. search_declarations(query="LoadGraph", kind="method")
2. get_callers(id="...", depth=1)
1. search_declarations(query="SqliteGraphRepository", kind="class")
2. get_relationships(id="...", relationshipKind="uses", direction="outgoing")
1. search_declarations(query="Sharpitect.Analysis.Graph", kind="namespace")
2. get_children(id="...", kind="class")
1. search_declarations(query="SaveNode", kind="method")
2. get_usages(id="...", usageKind="call")
| Tool | Purpose | When to Use |
|---|---|---|
search_declarations | Find declarations by name | First step for finding any C# element |
get_inheritance | Get type hierarchy | Understanding class/interface relationships |
get_callers | Find who calls a method | Tracing method usage upstream |
get_callees | Find what a method calls | Understanding method dependencies |
get_usages | Find all references | Comprehensive usage analysis |
get_relationships | Get all relationships | Exploring complex relationships |
get_dependencies | Project dependencies | Understanding project references |
get_tree | Containment hierarchy | Exploring code structure |
get_signature | Type/method signature | Getting detailed type information |
get_file_declarations | Declarations in a file | Quick overview of file contents |
Read to see implementationkind parameter to filter (class, interface, method, property, etc.)get_callers/get_callees, start with depth=1, increase if neededsharpitect analyze)Grep pattern="class.*IGraphRepository" to find implementations
1. search_declarations(query="IGraphRepository", kind="interface", matchMode="exact")
2. get_inheritance(id="...", direction="descendants")
Grep pattern="LoadGraph\\(" to find method calls
1. search_declarations(query="LoadGraph", kind="method")
2. get_callers(id="...")
Read all files in a namespace to understand structure
1. search_declarations(query="Sharpitect.Analysis", kind="namespace")
2. get_tree(rootId="...", maxDepth=2)
When working with C# code, think "Sharpitect first, generic tools second." Sharpitect understands C# semantics and provides accurate, efficient navigation. Only fall back to Grep/Glob/Read when you need non-semantic searches or actual source code content.