技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
roslyn-query【数据与研究】Query .NET/C# codebases using Roslyn AST analysis via dotnet run file. Use for tracing data flow, auditing API usage, finding pattern violations, or ad-hoc codebase queries.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Query .NET/C# codebases using Roslyn AST analysis scripts executed via dotnet run file.cs.
Before generating scripts, load the handbook-dotnet:dotnet-run-file skill for execution conventions and directive syntax.
Uses CSharpSyntaxTree.ParseText() — parses files individually, no solution loading.
Best for:
x.Content = ...)Uses MSBuildWorkspace — loads project, resolves types, enables cross-file analysis.
Best for:
SymbolFinder.FindCallersAsync)SymbolFinder.FindImplementationsAsync)SymbolFinder.FindOverridesAsync)SemanticModel.AnalyzeDataFlow)Based on the user's request, choose the appropriate template from references/templates.md. If no template fits, compose a custom script using the patterns documented there.
Create a .cs file in a scripts/ directory (or temp location) using dotnet run file.cs format with #:package directives.
For syntax-only analysis:
#:package Microsoft.CodeAnalysis.CSharp@4.*
For semantic analysis, additionally:
#:package Microsoft.CodeAnalysis.CSharp.Workspaces@4.*
#:package Microsoft.CodeAnalysis.Workspaces.MSBuild@4.*
#:package Microsoft.Build.Locator@1.*
#:property DisableMSBuildAssemblyCopyCheck=true
Note:
DisableMSBuildAssemblyCopyCheck=truesuppresses the MSBL001 build error that requiresExcludeAssets="runtime"on MSBuild packages — an attribute#:packagedirectives can't express. Safe for throwaway analysis scripts.
.slnxnot supported: Roslyn 4.xMSBuildWorkspaceonly supports.sln, not.slnx. UseOpenProjectAsyncwith a.csprojinstead — transitive project references are loaded automatically.
args[0], default to Directory.GetCurrentDirectory()Path.GetRelativePath() for output pathsdotnet run scripts/my-analysis.cs -- <target-path>
Analyze the output. For taint analysis, categorize findings:
Load references/roslyn-api.md for detailed API reference with code examples.
Load references/templates.md for ready-to-use analysis script templates.