一键导入
dotnet-aot-analysis
Analyzes and configures a .NET project or solution for Native AOT compatibility. Orchestrates source generator skills and applies AOT settings.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyzes and configures a .NET project or solution for Native AOT compatibility. Orchestrates source generator skills and applies AOT settings.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Converts a .NET solution to use Central Package Management (CPM). Use when the user wants to centralize, consolidate, or unify NuGet package versions across projects.
Enables tab autocomplete for the dotnet CLI. Use when the user wants to set up shell completion for dotnet commands.
Enables the Microsoft Testing Platform runner in global.json. Use when the user wants to enable or migrate to the new .NET testing platform.
Configures polymorphic JSON serialization with [JsonPolymorphic] and [JsonDerivedType] attributes
Configures System.Text.Json source generation for AOT-compatible JSON serialization
Converts logging to use the LoggerMessage source generator for high-performance, AOT-compatible logging. Use when the user wants to optimize logging or organize log messages.
| name | dotnet-aot-analysis |
| description | Analyzes and configures a .NET project or solution for Native AOT compatibility. Orchestrates source generator skills and applies AOT settings. |
| license | MIT |
| metadata | {"author":"Im5tu","version":"1.0","repositoryUrl":"https://github.com/im5tu/dotnet-skills"} |
| allowed-tools | Bash(dotnet:*) Read Glob Grep AskUserQuestion |
Analyze and configure a .NET project or solution for Native AOT compatibility, applying source generators and AOT settings.
Ask user: Solution-wide or Specific project(s)?
For each project:
Microsoft.AspNetCore refs, WebApplication, CreateBuilder)Microsoft.AspNetCore.Components.Server)AddControllersWithViews, AddMvc)Ask user: Continue with compatible projects or abort?
For each compatible project, invoke:
dotnet-source-gen-json - JSON serialization AOT readiness (includes polymorphic types)dotnet-source-gen-options-validation - Options pattern AOT readinessdotnet-source-gen-regex - Regex AOT readinessdotnet-source-gen-logging - Logging AOT readinessIf solution-wide:
Check for src/Directory.Build.props, otherwise use solution root. Add/merge:
<Project>
<PropertyGroup>
<!-- Advisory flag for tooling/analyzers; does not make code AOT-compatible -->
<IsAotCompatible>true</IsAotCompatible>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
<EnableAotAnalyzer>true</EnableAotAnalyzer>
</PropertyGroup>
</Project>
If project-specific:
Add to each .csproj:
<PropertyGroup>
<PublishAot>true</PublishAot>
</PropertyGroup>
For ASP.NET Core projects:
CreateSlimBuilder() over CreateBuilder()<PropertyGroup>
<EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>
</PropertyGroup>
dotnet-source-gen-json skillCreateSlimBuilder)<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>Run dotnet build and check for AOT warnings.
CreateSlimBuilder() for optimal sizeJsonSerializerContext