dotnet-roslyn-codelens

Navigate, diagnose, and refactor C# solutions through Roslyn semantic analysis.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/bsamiee/Rasm --skill dotnet-roslyn-codelens-bsamiee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-roslyn-codelens
Source: https://github.com/bsamiee/Rasm/tree/main/.claude/skills/dotnet-roslyn-codelens
Command: npx skills add https://github.com/bsamiee/Rasm --skill dotnet-roslyn-codelens-bsamiee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Text search and grep miss C# symbols hidden behind aliases, partial types, generic instantiations, and metadata assemblies, and running dotnet build just to check diagnostics is slow. This Skill routes code questions to the roslyn-codelens MCP server, which resolves every symbol through the actual Roslyn compilation of a loaded solution. ## Core Features & Use Cases - Symbol Navigation and Search: Find definitions, references, callers, implementations, attribute usages, and test coverage for any type or member across the solution. - Diagnostics and Refactoring: Read compiler and analyzer diagnostics, preview and apply code actions, rename symbols solution-wide, and change method signatures with all call sites rewritten. - Code Quality and Architecture Audits: Detect dead code, async violations, disposable misuse, god objects, circular dependencies, and layering violations with complexity metrics. - Use Case: Before renaming a method used across 40 files, call rename_symbol in preview mode to see every cascaded change, then apply it knowing references, overrides, nameof expressions, and doc comments all update consistently. ## Quick Start Ask the assistant to find all callers of a specific C# method or to show compiler diagnostics for the loaded solution using the Roslyn tools instead of grep or dotnet build.

Frequently Asked Questions about dotnet-roslyn-codelens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find all references to a C# method across a solution?▼

Use find_references with the method name to get every occurrence across the loaded solution, each tagged with a ReferenceKind like invocation, read, or write. For call sites only, find_callers is more direct, and kinds filters narrow results on the server.

How to rename a C# symbol everywhere without breaking references?▼

Use rename_symbol, which runs the Roslyn Renamer across the solution and cascades to references, overrides, nameof expressions, and doc crefs. It previews by default and refuses to apply when files changed on disk or new compiler errors would appear unless force=true is passed.

Can Roslyn diagnostics replace running dotnet build?▼

get_diagnostics returns compiler errors, warnings, and analyzer diagnostics without a build, but pass includeAnalyzers=true when the answer must match a build that treats analyzer warnings as errors. If the summary reports unreliable, run rebuild_solution and retry.

Why does get_code_fixes return SolutionNotTrusted?▼

Code fix providers load as analyzer code, so solutions not named on the server command line require explicit trust. Call trust_solution and retry; scope defaults to session, while persistent writes the path to the trust store.

What are the limitations of exception flow analysis in C#?▼

get_exception_flow sees only explicit throw statements, so implicit runtime exceptions like null dereferences and reflection-invoked throws go unreported. It models async synchronously, which is correct for awaited calls but wrong for fire-and-forget invocations.

Does symbol search work with external NuGet assemblies?▼

Yes, but only for assemblies the loaded solution references. Use get_nuget_dependencies to find the exact assembly name, then inspect_external_assembly to browse its API or peek_il to read a method's bytecode.