SkillsReviewed · NikiforovAll

Roslyn Query

Roslyn Query is an assistant skill for C# developers who want to inspect codebases, but its ready-made checks need adaptation and can miss important cases. It provides Roslyn API guidance and seven C# script templates for syntax checks and project-aware analysis through file-based dotnet execution.

Researched 16 Nov 2026

In short.

Roslyn Query is an assistant skill for developers investigating C# projects, but its examples provide investigation leads rather than proof of complete coverage or security. Its practical core is seven templates covering property assignments, empty catches, complexity, interface declarations, method modifiers, return expressions and call trees. Simple checks parse source files; project-aware patterns use compiler symbols through MSBuildWorkspace. Important limits include name-based matching, floating package versions, an external companion skill and a call tracer that suppresses workspace diagnostics. Execution, accuracy, compatibility and performance are unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Scope consists of plugins/handbook-dotnet/skills/roslyn-query/SKILL.md, references/roslyn-api.md and references/templates.md at commit a680d8fee4b815aecc2582fb854a3212fcffc977, plus the repository-level LICENSE. The companion dotnet-run-file skill, broader plugin installation, other repository contents and restored dependency implementations are outside this scope. Nothing was executed. Installation success, runtime behavior, project compatibility, security coverage, accuracy and performance remain unassessed.

The overview

identity

Roslyn Query, named roslyn-query in its metadata, belongs to the handbook-dotnet plugin in NikiforovAll/claude-code-rules. The selected resource contains SKILL.md and two references: roslyn-api.md and templates.md.

Its purpose is to guide an assistant in writing C# scripts that query C# source structure or compiler-resolved symbols. The original source location is [https://github.com/NikiforovAll/claude-code-rules/tree/main/plugins/handbook-dotnet/skills/roslyn-query].

assessment

The strongest fit is a developer answering a bounded question such as where empty catches occur or which assignments mention a particular property. The templates expose their matching rules, making their scope easier to inspect and adapt.

Broader claims need caution. The property audit looks for a sanitizer call within an assignment expression, while the call tracer follows symbols found in source syntax. Neither implementation establishes complete source-to-sink tracking or runtime behavior. No execution results establish how reliably the scripts work on real projects.

users

The skill suits C# developers, reviewers and maintainers investigating code quality, API use or project structure. Experienced developers can replace textual heuristics with symbol-based queries using the supplied API examples.

Beginners have a concrete starting point in the empty-catch template, but still need help configuring paths, understanding C# syntax and interpreting findings. The material assumes familiarity with command-line execution, package directives and, for semantic analysis, project loading.

capabilities

The seven templates inspect assignments to configured property names, detect catch blocks with no statements, calculate a defined complexity score, match interface names in class base lists, label methods by modifiers, inspect return expressions for a named sanitizer and print a recursive call tree.

The API reference also demonstrates finding callers, interface implementations, block-level data flow, expression types and resolved symbols. These examples support custom scripts; they do not establish a complete implementation of every advertised use case, such as architecture validation or whole-program taint analysis.

Using it

requirements

Execution requires access to the target source and a .NET SDK supporting the documented dotnet run file.cs format and #:package directives. The minimum SDK version and supported operating systems are unspecified. The instructions also depend on handbook-dotnet:dotnet-run-file, whose contents are outside this resource.

Syntax scripts declare Microsoft.CodeAnalysis.CSharp@4.*. Semantic scripts additionally use Roslyn workspace packages at 4.* and Microsoft.Build.Locator@1.*, together with an MSBuild installation discoverable by RegisterDefaults. Exact resolved dependency versions are unknown because these declarations float within major versions.

The skill warns that its Roslyn 4.x workspace approach does not support .slnx and recommends opening a .csproj instead. Compatibility with any particular project or installed toolchain is unassessed.

mechanism

Syntax analysis turns each source file into a tree representing language constructs such as assignments, methods and catch blocks. The templates walk those trees and match node shapes or names. This avoids project loading, but does not establish which actual property, type or method a matching name denotes.

Semantic analysis opens a project through MSBuildWorkspace and obtains compilations, symbols and semantic models. The call tracer resolves invocation expressions and recursively visits source declarations. The data-flow example inspects symbols entering, leaving, read within or written within one block; additional logic would be needed to turn that into a security analysis.

setup

Keep SKILL.md with both reference files because its instructions refer to them. The documented sequence is to load the companion dotnet-run-file skill, choose a template, save an adapted .cs file in scripts or a temporary directory, and execute it against the intended target. Plugin installation and assistant activation steps are not supplied.

The general invocation is dotnet run scripts/my-analysis.cs -- <target-path>. Syntax templates usually accept a directory; the call-tree template instead takes a project file, class name, method name and optional depth. Configure property names, sanitizer names or thresholds where applicable.

The semantic guidance includes #:property DisableMSBuildAssemblyCopyCheck=true to suppress the documented MSBL001 issue. Before use, decide which files belong in scope: the recursive syntax templates contain no explicit exclusions for generated or build-output directories.

example

For a narrow exception-handling review, save Template 2 as scripts/empty-catches.cs and use the documented command form: dotnet run scripts/empty-catches.cs -- ./src. This is an illustrative invocation; it was not executed.

The supplied code recursively examines .cs files and reports a file and line when a catch block contains zero statements. It returns 1 when it finds such blocks and 0 otherwise. By inspection, a catch containing a statement that still suppresses an exception would fall outside this rule, so the result would answer only the narrower structural question.

Assessment & evidence

limitations

The property audit matches member-access assignments by property name and marks them sanitized if any matching call name occurs inside the right-hand expression. By inspection, it can miss other assignment forms and cannot prove that every part of a value passed through the sanitizer. The return audit filters method names rather than checking return types and examines explicit return statements.

The interface template matches written base-list names, while the override template matches method names and modifiers. These heuristics do not establish inherited interface implementations or actual override chains. Templates 3 through 6 also lack an explicit findings-based exit status, despite the skill's general exit-code convention.

The call tracer discards workspace diagnostics, selects the first matching class and method name, defaults to depth five and suppresses repeated traversal through a shared visited set. These choices can limit coverage or choose an unintended entry point. Unresolved invocations are not traced.

The interpretation guidance categorizes AI output and generated code as trusted sources without demonstrating a safety check. Their origin alone does not establish that content is safe for a particular sink.

reasoning

The distinction between syntax and semantics is useful: a structural question can often be expressed as a small tree query, while identifying actual callers or implementations needs resolved symbols. The resource provides examples of both approaches.

The implementations support a narrower conclusion than some template descriptions suggest. Finding a sanitizer name is not evidence that every path is sanitized, and listing calls visible in source is not a complete execution model. These are deductions from the supplied code, not measured accuracy findings. The resource is best used to gather inspectable leads for further review.

alternatives

Within the supplied material, developers can use the Roslyn API reference directly instead of asking an assistant to adapt a template. For interface searches, the semantic SymbolFinder example offers a symbol-based approach alongside the simpler base-list name matcher.

Choose syntax-only inspection for clearly defined source patterns and project-aware analysis when symbol identity matters. The evidence supplies no comparisons with external products, dedicated analyzers or IDE features, so relative accuracy, speed and setup effort are unknown.

evidence

The skill definition documents intended use, dependencies and execution conventions: [https://raw.githubusercontent.com/NikiforovAll/claude-code-rules/a680d8fee4b815aecc2582fb854a3212fcffc977/plugins/handbook-dotnet/skills/roslyn-query/SKILL.md].

The API reference provides syntax and semantic examples: [https://raw.githubusercontent.com/NikiforovAll/claude-code-rules/a680d8fee4b815aecc2582fb854a3212fcffc977/plugins/handbook-dotnet/skills/roslyn-query/references/roslyn-api.md].

The template file exposes the seven scripts and their matching logic: [https://raw.githubusercontent.com/NikiforovAll/claude-code-rules/a680d8fee4b815aecc2582fb854a3212fcffc977/plugins/handbook-dotnet/skills/roslyn-query/references/templates.md]. No execution logs, accuracy measurements, performance benchmarks or demonstrated real-project outcomes are supplied.

Access & freshness

costs

The captured Apache 2.0 license grants no-charge, royalty-free rights subject to its conditions. The skill supplies no pricing, subscription requirements, token estimates or operating-cost figures.

Assistant access, computing resources, dependency restoration and support costs are unknown. There are no measured runtime or resource-use results from which to estimate the cost of analyzing a large repository.

rights

The repository LICENSE supplies Apache License 2.0 terms permitting reproduction, modification and redistribution, including commercial use, subject to the stated conditions. Redistribution requires a license copy, retention of applicable notices and prominent change notices in modified files. Applicable NOTICE attribution must also be carried forward if such material accompanies the work.

The license includes a conditional contributor patent grant, does not generally grant trademark rights and provides the work without warranty. It does not establish the licensing terms of separately restored dependencies or rights over code being analyzed. The captured license is available at [https://raw.githubusercontent.com/NikiforovAll/claude-code-rules/a680d8fee4b815aecc2582fb854a3212fcffc977/LICENSE].

freshness

The supplied snapshot identifies commit a680d8fee4b815aecc2582fb854a3212fcffc977 and capture time 2026-11-16T18:43:57.345Z. The capture time establishes when this material was retained, not when the skill was last updated.

No release number, maintenance history or compatibility matrix is supplied. The 4.* and 1.* package declarations do not identify exact dependency builds. Later repository changes and compatibility with currently resolved packages are unknown.

actions

Begin with one explicit question and the smallest relevant source directory. Obtain the companion execution guidance, confirm SDK support and retain both reference files. For repeatable work, replace floating package declarations with versions validated for the intended environment.

Before relying on findings, check the adapted script against known matching and nonmatching examples. Define exclusions, inspect workspace diagnostics and distinguish a clean result from incomplete loading. Add findings-based exit codes where automation requires them.

For sanitization work, verify how the value reaches its sink rather than accepting a matching call name or AI authorship as proof. For call tracing, identify the intended overload and review depth and traversal limits.

Evidence for this report

LICENSEnotice · checked 2026-11-16