Agent skill

dotnet-aot-compat

Make .NET projects compatible with Native AOT and trimming by systematically resolving IL trim/AOT analyzer warnings. USE FOR: making projects AOT-compatible, fixing trimming warnings, resolving IL warnings (IL2026, IL2070, IL2067, IL2072, IL3050), adding DynamicallyAccessedMembers annotations, enabling IsAotCompatible. DO NOT USE FOR: publishing native AOT binaries, optimizing binary size, replacing reflection-heavy libraries with alternatives.

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill dotnet-aot-compat --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 16 KB
Bundled scripts: none
Path: plugins/dotnet-upgrade/skills/dotnet-aot-compat/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# dotnet-aot-compat Make .NET projects compatible with Native AOT and trimming by systematically resolving all IL trim/AOT analyzer warnings. ## When to Use This Skill - **"Make this project AOT-compatible"** - **"Fix trimming warnings"** or **"fix IL warnings"** - **"Resolve IL2070 / IL2067 / IL2072 / IL2026 / IL3050 warnings"** - **"Add DynamicallyAccessedMembers annotations"** - **"Enable IsAotCompatible in my .csproj"** - **"My project has trim analyzer warnings after upgrading to net8.0"** - **"Annotate reflection code for the trimmer"** ## When Not to Use This Skill Do not use this skill when the project exclusively targets .NET Framework (net4x), which does not support the trim/AOT analyzers. ## Prerequisites An existing .NET project targeting net8.0 or later (or multi-targeting with at least one net8.0+ TFM) and the corresponding .NET SDK installed. ## Background: What AOT Compatibility Means Native AOT and the IL trimmer perform static analysis to determine what code is reachable. Reflection can break this analysis because the trimmer can't see what types/members are accessed at runtime. The `IsAotCompatible` property enables analyzers that flag these issues as build warni

What's inside
Steps it walks through
  1. When to Use This Skill
  2. When Not to Use This Skill
  3. Prerequisites
  4. Background: What AOT Compatibility Means
  5. Critical Rules
  6. ❌ Never suppress warnings incorrectly
  7. 💡 Preferred approaches
  8. Annotation flow is key
  9. Step-by-Step Procedure
  10. Step 1: Enable AOT analysis in the .csproj
  11. Step 2: Build and collect warnings
  12. Step 3: Triage warnings by code (do NOT read every file)
  13. Step 4: Fix warnings iteratively (innermost first)
  14. Step 5: Rebuild and repeat
Ships with 1 file
  • references/polyfills.md
Commands it runs
dotnet build <project.csproj> -f <net8.0-or-later-tfm> --no-incremental 2>&1 | grep 'IL[0-9]\{4\}'
grep -rl 'JsonSerializer\.\(Serialize\|Deserialize\)' src/ --include='*.cs'
dotnet build <project.csproj>  # builds all TFMs
More from skills
All skills →
About this skill
What does the dotnet-aot-compat skill do?

Make .NET projects compatible with Native AOT and trimming by systematically resolving IL trim/AOT analyzer warnings. USE FOR: making projects AOT-compatible, fixing trimming warnings, resolving IL warnings (IL2026, IL2070, IL2067, IL2072, IL3050), adding DynamicallyAccessedMembers annotations, enabling IsAotCompatible. DO NOT USE FOR: publishing native AOT binaries, optimizing binary size, replacing reflection-heavy libraries with alternatives.

How do I install it?

Run `npx skills add dotnet/skills --skill dotnet-aot-compat --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going