Skills for Real Engineers. Straight from my .agents directory.
aot-trimming
Agent skill fromAaronontheweb/dotnet-skills
Guidelines for making .NET libraries and applications trimming-safe and Native AOT compatible. Covers the trimming/AOT model, the MSBuild properties that enable analysis (IsTrimmable, IsAotCompatible, PublishTrimmed, PublishAot), the trimming attributes (RequiresUnreferencedCode, RequiresDynamicCode, DynamicallyAccessedMembers, UnconditionalSuppressMessage), IL2xxx/IL3xxx warning codes, and a pattern playbook: source generators and UnsafeAccessor, generated-interception diagnostic suppressors, intentional runtime scanning boundaries, trimming-safe islands and feature switches, migration analyzers, and temporary warning-approval baselines. Use when introducing trimming/AOT support, resolving IL2xxx/IL3xxx warnings, or making reflection-heavy code trimming-safe in C# / .NET codebases. For System.Text.Json AOT scenarios, see also the serialization skill.
How to install aot-trimming
npx skills add Aaronontheweb/dotnet-skills# or add only this skill to Claude Code: copy the folder
skills/aot-trimming/
# into
~/.claude/skills/aot-trimming/ (all projects)
.claude/skills/aot-trimming/ (one project)
1# .NET Trimming and Native AOT23## When to Use45- Adding trimming (`PublishTrimmed`) or Native AOT (`PublishAot`) support to a library or application6- Resolving `IL2xxx` (trimming) and `IL3xxx` (AOT/single-file) warnings7- Making reflection-heavy code trimming-safe8- Replacing runtime reflection, assembly scanning, or `Reflection.Emit` with compile-time alternatives9- Reviewing a codebase or PR for trimming/AOT compatibility, including generated interceptors and analyzer suppressors10- Designing public APIs that must carry trimming annotations1112## Core Goals1314- Produce code that survives the linker's reachability analysis and runs under Native AOT (no JIT).15- Express what the compiler cannot see — which members reflection needs — using the trimming attributes.16- Keep trimming-safe and trimming-unsafe code separated so unsafe paths are explicit and contained.1718## Core Model1920### Trimming vs Native AOT2122- **Trimming** (`PublishTrimmed`) runs ILLink reachability analysis: only statically reachable code is kept. Reflection the analyzer cannot see is trimmed away and produces warnings.23- **Native AOT** (`PublishAot`) makes trimming mandatory and removes the JIT. `Reflection.Emit` is unsupported, constructing *unknown* generic instantiations at runtime is not guaranteed, `Expression.Compile()` may fall back to interpretation, and reflection works only over members the linker preserved.24- Both run the same static analysis:25…
Excerpt shown under the repository's MIT license.
More skills in dotnet-skills
Similar skill repositories
Public repository for Agent Skills
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create motion, prototypes, websites, apps, dashboards, presentations, images, and videos with your team and AI agents. Share work, exchange feedback, and iterate together in one workspace.
Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
