[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79XZZ6NFEN6FKRA69CCMDP2":3,"skill-same:01M79XZZ6NFEN6FKRA69CCMDP2":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M79XZZ6NFEN6FKRA69CCMDP2","aot-trimming",null,"Turn on PublishAot\u002FPublishTrimmed in any .NET app; write or review trim\u002FAOT-safe code and its IL warnings. Not for existing-library adoption or project-wide IL-warning migration: user-invoked dotnet-aot-compat.","Blind-Striker\u002Fagent-skills-and-plugins","Blind-Striker","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1965259?v=4","01M79WFXTE5PH0C1VB7B54ANMN","Deniz İrgin","01M79WFXV5KZ5GST1K8G035DM5",1,"MIT","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fplugins\u002Fdeniz-dotnet-general\u002Fskills\u002Faot-trimming\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: aot-trimming\ndescription: \"Turn on PublishAot\u002FPublishTrimmed in any .NET app; write or review\n  trim\u002FAOT-safe code and its IL warnings. Not for existing-library adoption or\n  project-wide IL-warning migration: user-invoked dotnet-aot-compat.\"\nuser-invocable: false\n---\n\n# .NET Trimming and Native AOT\n\nThis skill assumes trim\u002FAOT analysis is already in effect for the code in scope, or that you are\nturning on `PublishAot` or `PublishTrimmed` in an app. To adopt `IsTrimmable` or `IsAotCompatible` in\nan existing library, or for a systematic migration of a project-wide IL-warning list, ask the user to\ninvoke `\u002Fdeniz-dotnet-general:dotnet-aot-compat`; do not perform that work through this skill.\n\n## When to Use\n\n- Turning on `PublishAot` or `PublishTrimmed` in an app, new or existing\n- Resolving the `IL2xxx` (trimming) and `IL3xxx` (AOT\u002Fsingle-file) warnings raised by the code you are writing or changing\n- Making reflection-heavy code trimming-safe\n- Replacing runtime reflection, assembly scanning, or `Reflection.Emit` with compile-time alternatives\n- Reviewing a codebase or PR for trimming\u002FAOT compatibility, including generated interceptors and analyzer suppressors\n- Designing public APIs that must carry trimming annotations\n\n## Core Goals\n\n- Produce code that survives the linker's reachability analysis and runs under Native AOT (no JIT).\n- Express what the compiler cannot see — which members reflection needs — using the trimming attributes.\n- Keep trimming-safe and trimming-unsafe code separated so unsafe paths are explicit and contained.\n\n## Core Model\n\n### Trimming vs Native AOT\n\n- **Trimming** (`PublishTrimmed`) runs ILLink reachability analysis: only statically reachable code is kept. Reflection the analyzer cannot see is trimmed away and produces warnings.\n- **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.\n- Both run the same static analysis:\n  - `IL2xxx` — trimming warnings: `RequiresUnreferencedCode` propagation + `DynamicallyAccessedMembers` dataflow.\n  - `IL3xxx` — AOT and single-file warnings: `RequiresDynamicCode` \u002F `RequiresAssemblyFiles`.\n\nA library can be trimmable but **not** AOT-compatible (it uses `Reflection.Emit`, which trimming tolerates but AOT does not).\n\n### The two problems to solve\n\n1. **Unseen reflection** (trimming): the linker removes a member or type you load by name, or reach through `typeof(T)` in a generic method.\n2. **Dynamic code generation** (AOT): the JIT is gone, so `Reflection.Emit` is unsupported and constructing *unknown* generic instantiations is not guaranteed.\n\nBoth are solved the same way: make the required members *statically visible* to the analyzer, or remove the need for reflection entirely.\n\n### Reflection is not the enemy\n\nReflection is a legitimate technique and is completely fine in ordinary JIT applications — you need none of this there. The trimming attributes exist to *allow* reflection under trimming\u002FAOT, not to forbid it: annotate what reflection needs, and the linker keeps it. Reach for source generators, `[UnsafeAccessor]`, or capability gating only when you want a specific reflective surface removed or contained (for example, a public registration API you do not want to ship with `[RequiresUnreferencedCode]`).\n\n## Project Configuration\n\nDeclare the library properties only on a **new** library you are creating; adopting them in an\nexisting library is the job of the manual ceremony named above. An app may turn on `PublishTrimmed` or\n`PublishAot` whether it is new or existing. When its publish raises a project-wide warning list rather\nthan warnings in the code you are changing, migrating that list is the manual ceremony's job. For\nexisting code, confirm what the project already declares before applying this guidance.\n\nFor a new **library**, declare compatibility so the analyzers surface warnings and consumers know:\n\n```xml\n\u003CPropertyGroup>\n  \u003C!-- Trim-compatible: enables trim warnings. -->\n  \u003CIsTrimmable>true\u003C\u002FIsTrimmable>\n\n  \u003C!-- AOT-compatible: implies IsTrimmable + EnableTrimAnalyzer + EnableSingleFileAnalyzer + EnableAotAnalyzer. -->\n  \u003CIsAotCompatible Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))\">true\u003C\u002FIsAotCompatible>\n\u003C\u002FPropertyGroup>\n```\n\nFor an **application**, new or existing, publish trimmed or AOT:\n\n```xml\n\u003CPropertyGroup>\n  \u003CPublishTrimmed>true\u003C\u002FPublishTrimmed>\n  \u003C!-- or -->\n  \u003CPublishAot>true\u003C\u002FPublishAot>\n\u003C\u002FPropertyGroup>\n```\n\nVerify by actually publishing — a trimmed\u002FAOT app must produce zero warnings:\n\n```bash\ndotnet publish -c Release -r \u003Crid> -p:PublishTrimmed=true\ndotnet publish -c Release -r \u003Crid> -p:PublishAot=true\n```\n\nA **test app** that roots the library is the standard way to validate a library:\n\n```xml\n\u003CPropertyGroup>\n  \u003CPublishTrimmed>true\u003C\u002FPublishTrimmed>\n\u003C\u002FPropertyGroup>\n\u003CItemGroup>\n  \u003CProjectReference Include=\"..\\MyLibrary\\MyLibrary.csproj\" \u002F>\n  \u003CTrimmerRootAssembly Include=\"MyLibrary\" \u002F>\n\u003C\u002FItemGroup>\n```\n\nSee [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md) for the full property table and feature switches.\n\n## The Attribute Model\n\nThese live in `System.Diagnostics.CodeAnalysis`. See [trimming-attributes-reference.md](trimming-attributes-reference.md) for the full catalog with exact signatures, warning codes, and rules.\n\n- `[RequiresUnreferencedCode(message)]` — marks code that needs members the linker cannot see. Suppresses warnings *inside*; emits `IL2026` at every call site.\n- `[RequiresDynamicCode(message)]` — marks code that needs a JIT (emitting, dynamic). Emits `IL3050` at call sites.\n- `[DynamicallyAccessedMembers(memberTypes)]` — declares which members of a `Type`\u002F`string` must be preserved. Flows *backward* from the reflection site to the `Type` source. Scope it (and the other attributes) to a single accessor by placing the attribute directly on the accessor, or with the `[method:]`, `[field:]`, or `[return:]` targets.\n- `[UnconditionalSuppressMessage(category, checkId, Justification = \"...\")]` — last-resort, IL-persisted suppression; must carry a justification and a real invariant.\n- `[DynamicDependency(\"Member\", typeof(T))]` — keeps named members but does **not** silence warnings.\n\nChoose the narrowest `DynamicallyAccessedMemberTypes` for the reflection you actually perform:\n\n| Reflection | Member type |\n| --- | --- |\n| `Activator.CreateInstance\u003CT>()`, `new T()`, `Activator.CreateInstance(type)` | `PublicParameterlessConstructor` |\n| DI activation (`ActivatorUtilities.CreateFactory\u003CT>`) | `PublicConstructors` |\n| Explicit non-public activation | `NonPublicConstructors` |\n| `type.GetInterfaces()` | `Interfaces` |\n| `type.GetMethods()` | `PublicMethods` (add `NonPublicMethods` when needed) |\n| `type.GetProperties()` | `PublicProperties` |\n| `type.GetFields()` | `PublicFields` |\n| `type.GetNestedTypes()` | `PublicNestedTypes` |\n\n## The Pattern Playbook (selection)\n\nFirst decide whether the code must be trimming\u002FAOT safe at all. A plain JIT app or library needs none of this — reflection is fine there. Only when you or a consumer publish trimmed\u002FAOT does reflection need to become visible to the linker.\n\nThe goal is never \"remove all reflection\"; it is *make the reflection statically visible* so the linker keeps what it needs. Choose per call site:\n\n- **Keep the reflection and annotate it** — the common case. Put `[DynamicallyAccessedMembers(...)]` on the `Type`\u002F`string` source and propagate it through the chain; mark entry points `[RequiresUnreferencedCode]`\u002F`[RequiresDynamicCode]`. The attributes exist precisely to let reflection work under trimming. See [trimming-attributes-reference.md](trimming-attributes-reference.md).\n\n- **Replace the reflection with a compile-time alternative** — when you want a reflective surface gone (for example, a public registration API you do not want to ship with `[RequiresUnreferencedCode]`). A **source generator** emits direct type references (marker attribute → generated registration); `[UnsafeAccessor]` replaces `FieldInfo`\u002F`MethodInfo`\u002F`ConstructorInfo`. See [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md#source-generators-and-compile-time-registration) and [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md#unsafe-accessors-for-non-public-members).\n\n- **Isolate a whole dynamic path** — when a path is inherently dynamic (emitting proxies, loading plugins by name), move it behind a boundary and provide a trimming-safe alternative selected by `RuntimeFeature.IsDynamicCodeSupported`. See [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md#trimming-safe-islands).\n\n- **Suppress only as a last resort** — a single `[UnconditionalSuppressMessage(...)]` at an invariant-proven leaf, with a `Justification`. Never `#pragma` (not persisted in IL).\n\nInside the `\u002Fdeniz-dotnet-general:dotnet-aot-compat` ceremony, its no-suppression rule governs. Outside it, a\njustified leaf `[UnconditionalSuppressMessage]` with a proven invariant and a `Justification` is allowed.\n\nSee [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md) for the full playbook, including object-overload → generic-overload redirects, generated-interception suppressors, intentional scanning boundaries, migration analyzers, and strict-mode precedence.\n\n## Reference Files\n\n- [trimming-attributes-reference.md](trimming-attributes-reference.md): The complete attribute catalog — `RequiresUnreferencedCode`, `RequiresDynamicCode`, `DynamicallyAccessedMembers` (full `DynamicallyAccessedMemberTypes` list), `UnconditionalSuppressMessage`, `DynamicDependency` — each with intent, exact signature, and rules, plus the `IL2xxx`\u002F`IL3xxx` warning-code table.\n- [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md): The full pattern playbook — source generators vs reflection, trimming-safe islands and capability guards, separating safe\u002Funsafe code, System.Text.Json source generation, object-overload → generic-overload redirects with `[OverloadResolutionPriority]` and opt-in analyzers, migration analyzers, known gotchas, and the full generation checklist.\n\n## Generation Checklist (Summary)\n\n1. **Project** — trim\u002FAOT analysis is already in effect for the code in scope, or you are creating a new library that declares `IsTrimmable`\u002F`IsAotCompatible`, or turning on `PublishTrimmed`\u002F`PublishAot` in an app; otherwise route the user to the manual ceremony. Zero warnings on publish.\n2. **Make reflection visible (or replace it)** — annotate the reflection you keep (`DynamicallyAccessedMembers`\u002F`RequiresUnreferencedCode`\u002F`RequiresDynamicCode`); replace it with source generators, generic (`typeof(T)`) APIs, or `[UnsafeAccessor]` only where you want the reflective surface gone.\n3. **Annotate** — narrowest `DynamicallyAccessedMembers` on every `Type`\u002F`string` source; propagate through the chain; `[RequiresUnreferencedCode]`\u002F`[RequiresDynamicCode]` on unsafe entry points.\n4. **Isolate** — keep unsafe reflective\u002Femit code behind a boundary; gate *dynamic-code* paths with `RuntimeFeature.IsDynamicCodeSupported`, and separate *trimming* paths with `#if` or annotations.\n5. **Suppress** — only with `[UnconditionalSuppressMessage]` + justification at invariant-proven leaves; never `#pragma`\u002F`SuppressMessage`.\n6. **Verify** — publish trimmed and AOT, run analyzers, and confirm zero warnings.\n\n## References\n\n- [Trimming options](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Ftrimming\u002Ftrimming-options)\n- [Prepare .NET libraries for trimming](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Ftrimming\u002Fprepare-libraries-for-trimming)\n- [Introduction to trim warnings](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Ftrimming\u002Ffixing-warnings)\n- [Native AOT deployment](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Fnative-aot\u002F)\n- [ILLink error codes](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fruntime\u002Fblob\u002Fmain\u002Fdocs\u002Ftools\u002Fillink\u002Ferror-codes.md)\n","# .NET Trimming and Native AOT\n\nThis skill assumes trim\u002FAOT analysis is already in effect for the code in scope, or that you are\nturning on `PublishAot` or `PublishTrimmed` in an app. To adopt `IsTrimmable` or `IsAotCompatible` in\nan existing library, or for a systematic migration of a project-wide IL-warning list, ask the user to\ninvoke `\u002Fdeniz-dotnet-general:dotnet-aot-compat`; do not perform that work through this skill.\n\n## When to Use\n\n- Turning on `PublishAot` or `PublishTrimmed` in an app, new or existing\n- Resolving the `IL2xxx` (trimming) and `IL3xxx` (AOT\u002Fsingle-file) warnings raised by the code you are writing or changing\n- Making reflection-heavy code trimming-safe\n- Replacing runtime reflection, assembly scanning, or `Reflection.Emit` with compile-time alternatives\n- Reviewing a codebase or PR for trimming\u002FAOT compatibility, including generated interceptors and analyzer suppressors\n- Designing public APIs that must carry trimming annotations\n\n## Core Goals\n\n- Produce code that survives the linker's reachability analysis and runs under Native AOT (no JIT).\n- Express what the compiler cannot see — which members reflection needs — using the trimming attributes.\n- Keep trimming-safe and trimming-unsafe code separated so unsafe paths are explicit and contained.\n\n## Core Model\n\n### Trimming vs Native AOT\n\n- **Trimming** (`PublishTrimmed`) runs ILLink reachability analysis: only statically reachable code is kept. Reflection the analyzer cannot see is trimmed away and produces warnings.\n- **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.\n- Both run the same static analysis:\n  - `IL2xxx` — trimming warnings: `RequiresUnreferencedCode` propagation + `DynamicallyAccessedMembers` dataflow.\n  - `IL3xxx` — AOT and single-file warnings: `RequiresDynamicCode` \u002F `RequiresAssemblyFiles`.\n\nA library can be trimmable but **not** AOT-compatible (it uses `Reflection.Emit`, which trimming tolerates but AOT does not).\n\n### The two problems to solve\n\n1. **Unseen reflection** (trimming): the linker removes a member or type you load by name, or reach through `typeof(T)` in a generic method.\n2. **Dynamic code generation** (AOT): the JIT is gone, so `Reflection.Emit` is unsupported and constructing *unknown* generic instantiations is not guaranteed.\n\nBoth are solved the same way: make the required members *statically visible* to the analyzer, or remove the need for reflection entirely.\n\n### Reflection is not the enemy\n\nReflection is a legitimate technique and is completely fine in ordinary JIT applications — you need none of this there. The trimming attributes exist to *allow* reflection under trimming\u002FAOT, not to forbid it: annotate what reflection needs, and the linker keeps it. Reach for source generators, `[UnsafeAccessor]`, or capability gating only when you want a specific reflective surface removed or contained (for example, a public registration API you do not want to ship with `[RequiresUnreferencedCode]`).\n\n## Project Configuration\n\nDeclare the library properties only on a **new** library you are creating; adopting them in an\nexisting library is the job of the manual ceremony named above. An app may turn on `PublishTrimmed` or\n`PublishAot` whether it is new or existing. When its publish raises a project-wide warning list rather\nthan warnings in the code you are changing, migrating that list is the manual ceremony's job. For\nexisting code, confirm what the project already declares before applying this guidance.\n\nFor a new **library**, declare compatibility so the analyzers surface warnings and consumers know:\n\n```xml\n\u003CPropertyGroup>\n  \u003C!-- Trim-compatible: enables trim warnings. -->\n  \u003CIsTrimmable>true\u003C\u002FIsTrimmable>\n\n  \u003C!-- AOT-compatible: implies IsTrimmable + EnableTrimAnalyzer + EnableSingleFileAnalyzer + EnableAotAnalyzer. -->\n  \u003CIsAotCompatible Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))\">true\u003C\u002FIsAotCompatible>\n\u003C\u002FPropertyGroup>\n```\n\nFor an **application**, new or existing, publish trimmed or AOT:\n\n```xml\n\u003CPropertyGroup>\n  \u003CPublishTrimmed>true\u003C\u002FPublishTrimmed>\n  \u003C!-- or -->\n  \u003CPublishAot>true\u003C\u002FPublishAot>\n\u003C\u002FPropertyGroup>\n```\n\nVerify by actually publishing — a trimmed\u002FAOT app must produce zero warnings:\n\n```bash\ndotnet publish -c Release -r \u003Crid> -p:PublishTrimmed=true\ndotnet publish -c Release -r \u003Crid> -p:PublishAot=true\n```\n\nA **test app** that roots the library is the standard way to validate a library:\n\n```xml\n\u003CPropertyGroup>\n  \u003CPublishTrimmed>true\u003C\u002FPublishTrimmed>\n\u003C\u002FPropertyGroup>\n\u003CItemGroup>\n  \u003CProjectReference Include=\"..\\MyLibrary\\MyLibrary.csproj\" \u002F>\n  \u003CTrimmerRootAssembly Include=\"MyLibrary\" \u002F>\n\u003C\u002FItemGroup>\n```\n\nSee [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md) for the full property table and feature switches.\n\n## The Attribute Model\n\nThese live in `System.Diagnostics.CodeAnalysis`. See [trimming-attributes-reference.md](trimming-attributes-reference.md) for the full catalog with exact signatures, warning codes, and rules.\n\n- `[RequiresUnreferencedCode(message)]` — marks code that needs members the linker cannot see. Suppresses warnings *inside*; emits `IL2026` at every call site.\n- `[RequiresDynamicCode(message)]` — marks code that needs a JIT (emitting, dynamic). Emits `IL3050` at call sites.\n- `[DynamicallyAccessedMembers(memberTypes)]` — declares which members of a `Type`\u002F`string` must be preserved. Flows *backward* from the reflection site to the `Type` source. Scope it (and the other attributes) to a single accessor by placing the attribute directly on the accessor, or with the `[method:]`, `[field:]`, or `[return:]` targets.\n- `[UnconditionalSuppressMessage(category, checkId, Justification = \"...\")]` — last-resort, IL-persisted suppression; must carry a justification and a real invariant.\n- `[DynamicDependency(\"Member\", typeof(T))]` — keeps named members but does **not** silence warnings.\n\nChoose the narrowest `DynamicallyAccessedMemberTypes` for the reflection you actually perform:\n\n| Reflection | Member type |\n| --- | --- |\n| `Activator.CreateInstance\u003CT>()`, `new T()`, `Activator.CreateInstance(type)` | `PublicParameterlessConstructor` |\n| DI activation (`ActivatorUtilities.CreateFactory\u003CT>`) | `PublicConstructors` |\n| Explicit non-public activation | `NonPublicConstructors` |\n| `type.GetInterfaces()` | `Interfaces` |\n| `type.GetMethods()` | `PublicMethods` (add `NonPublicMethods` when needed) |\n| `type.GetProperties()` | `PublicProperties` |\n| `type.GetFields()` | `PublicFields` |\n| `type.GetNestedTypes()` | `PublicNestedTypes` |\n\n## The Pattern Playbook (selection)\n\nFirst decide whether the code must be trimming\u002FAOT safe at all. A plain JIT app or library needs none of this — reflection is fine there. Only when you or a consumer publish trimmed\u002FAOT does reflection need to become visible to the linker.\n\nThe goal is never \"remove all reflection\"; it is *make the reflection statically visible* so the linker keeps what it needs. Choose per call site:\n\n- **Keep the reflection and annotate it** — the common case. Put `[DynamicallyAccessedMembers(...)]` on the `Type`\u002F`string` source and propagate it through the chain; mark entry points `[RequiresUnreferencedCode]`\u002F`[RequiresDynamicCode]`. The attributes exist precisely to let reflection work under trimming. See [trimming-attributes-reference.md](trimming-attributes-reference.md).\n\n- **Replace the reflection with a compile-time alternative** — when you want a reflective surface gone (for example, a public registration API you do not want to ship with `[RequiresUnreferencedCode]`). A **source generator** emits direct type references (marker attribute → generated registration); `[UnsafeAccessor]` replaces `FieldInfo`\u002F`MethodInfo`\u002F`ConstructorInfo`. See [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md#source-generators-and-compile-time-registration) and [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md#unsafe-accessors-for-non-public-members).\n\n- **Isolate a whole dynamic path** — when a path is inherently dynamic (emitting proxies, loading plugins by name), move it behind a boundary and provide a trimming-safe alternative selected by `RuntimeFeature.IsDynamicCodeSupported`. See [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md#trimming-safe-islands).\n\n- **Suppress only as a last resort** — a single `[UnconditionalSuppressMessage(...)]` at an invariant-proven leaf, with a `Justification`. Never `#pragma` (not persisted in IL).\n\nInside the `\u002Fdeniz-dotnet-general:dotnet-aot-compat` ceremony, its no-suppression rule governs. Outside it, a\njustified leaf `[UnconditionalSuppressMessage]` with a proven invariant and a `Justification` is allowed.\n\nSee [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md) for the full playbook, including object-overload → generic-overload redirects, generated-interception suppressors, intentional scanning boundaries, migration analyzers, and strict-mode precedence.\n\n## Reference Files\n\n- [trimming-attributes-reference.md](trimming-attributes-reference.md): The complete attribute catalog — `RequiresUnreferencedCode`, `RequiresDynamicCode`, `DynamicallyAccessedMembers` (full `DynamicallyAccessedMemberTypes` list), `UnconditionalSuppressMessage`, `DynamicDependency` — each with intent, exact signature, and rules, plus the `IL2xxx`\u002F`IL3xxx` warning-code table.\n- [aot-trimming-playbook-reference.md](aot-trimming-playbook-reference.md): The full pattern playbook — source generators vs reflection, trimming-safe islands and capability guards, separating safe\u002Funsafe code, System.Text.Json source generation, object-overload → generic-overload redirects with `[OverloadResolutionPriority]` and opt-in analyzers, migration analyzers, known gotchas, and the full generation checklist.\n\n## Generation Checklist (Summary)\n\n1. **Project** — trim\u002FAOT analysis is already in effect for the code in scope, or you are creating a new library that declares `IsTrimmable`\u002F`IsAotCompatible`, or turning on `PublishTrimmed`\u002F`PublishAot` in an app; otherwise route the user to the manual ceremony. Zero warnings on publish.\n2. **Make reflection visible (or replace it)** — annotate the reflection you keep (`DynamicallyAccessedMembers`\u002F`RequiresUnreferencedCode`\u002F`RequiresDynamicCode`); replace it with source generators, generic (`typeof(T)`) APIs, or `[UnsafeAccessor]` only where you want the reflective surface gone.\n3. **Annotate** — narrowest `DynamicallyAccessedMembers` on every `Type`\u002F`string` source; propagate through the chain; `[RequiresUnreferencedCode]`\u002F`[RequiresDynamicCode]` on unsafe entry points.\n4. **Isolate** — keep unsafe reflective\u002Femit code behind a boundary; gate *dynamic-code* paths with `RuntimeFeature.IsDynamicCodeSupported`, and separate *trimming* paths with `#if` or annotations.\n5. **Suppress** — only with `[UnconditionalSuppressMessage]` + justification at invariant-proven leaves; never `#pragma`\u002F`SuppressMessage`.\n6. **Verify** — publish trimmed and AOT, run analyzers, and confirm zero warnings.\n\n## References\n\n- [Trimming options](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Ftrimming\u002Ftrimming-options)\n- [Prepare .NET libraries for trimming](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Ftrimming\u002Fprepare-libraries-for-trimming)\n- [Introduction to trim warnings](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Ftrimming\u002Ffixing-warnings)\n- [Native AOT deployment](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fdeploying\u002Fnative-aot\u002F)\n- [ILLink error codes](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fruntime\u002Fblob\u002Fmain\u002Fdocs\u002Ftools\u002Fillink\u002Ferror-codes.md)\n",{"name":5,"description":7,"user-invocable":20},"master","b30b1c1908dbc56a8184128f18803053d762ccb5","plugins\u002Fdeniz-dotnet-general\u002Fskills\u002Faot-trimming",0,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins","https:\u002F\u002Fgithub.com\u002FBlind-Striker","denizirgin.com","VP of Engineering - \r\n@armutcom @homeruntech @prontopro\r\n |  Speaker \r\n@CodeFiction\r\n, http:\u002F\u002Fcodefiction.tech | Developer, gamer, blogger, maiden iron fan","2026-11-13 00:23:18",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill aot-trimming",{"tool":39,"command":40},"bunx","bunx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill aot-trimming",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill aot-trimming","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fplugins\u002Fdeniz-dotnet-general\u002Fskills\u002Faot-trimming\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"aot-trimming-playbook-reference.md","REFERENCE","参考文档",34411,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fplugins\u002Fdeniz-dotnet-general\u002Fskills\u002Faot-trimming\u002Faot-trimming-playbook-reference.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"trimming-attributes-reference.md",14983,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fplugins\u002Fdeniz-dotnet-general\u002Fskills\u002Faot-trimming\u002Ftrimming-attributes-reference.md",[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M79YGWBJ52PHMSTKJ3RJ3AWR","writing-tunit-tests","Write tests in TUnit — the attributes, the async assertion model, data-driven cases, lifecycle hooks, and the parallelism rules. USE FOR writing or fixing a test in a TUnit project, translating a test idea into TUnit syntax, or reviewing TUnit test code for API mistakes. DO NOT USE FOR deciding what to test, judging whether a test is any good, or running tests.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fwriting-tunit-tests\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79YGR3Y9RCRS6TD71D0KKP8","dotnet-walls","Walls for a .NET change in a repository without its own quality gates — pinned, ephemeral analyzer, format, clone and scanner commands for the verify step, their identity ratchet, and the build traps. Use during a walls preflight, or when a worker's verify step needs .NET quality gates.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fdotnet-walls\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79YGFNJBST7D803NQW3SBYM","csharp-15","Write, review and modernize C# 15 (.NET 11) code correctly. Covers every C# 15 feature - collection expression arguments (`[with(...), ...]`), union types (`union`, `[Union]`, `IUnion`, custom unions), closed class hierarchies (`closed`), extension indexers, labeled `break`\u002F`continue`, non-virtual static interface members on runtimes without default interface methods, and the preview memory-safety model (`unsafe(expr)`, `safe`, requires-unsafe members). Use when code targets net11.0 or LangVersion 15\u002Fpreview, when the user mentions any of these features, when replacing marker interfaces, OneOf-style results, `goto`\u002Fflag loop exits or capacity\u002Fcomparer boilerplate, or when the build reports CS8121, CS8509, CS8655, CS8510, CS0121\u002FCS0411 on a `with(...)` element, CS9370, CS9380 or CS9363.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fcsharp-15\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79YGAV031473HSX6FN87ENH","verified-waves","Run one task as verified multi-agent waves. Plans the fan-out, sends findings to fresh skeptics, keeps a ledger, and reports N of M done; small tasks stay solo.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fverified-waves\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79YG6QXNND4WRPP3GATSY8J","harness","The bundled dispatch harness, which runs a task file on worker models through OpenCode or Codex, fences their writes, escalates their asks to the operator, settles each result from git and its verify commands, and records every step in a ledger. Its commands, task file, modes and write fence, configuration, runs and their recovery, ledger and exit codes.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fharness\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79YG2P5S91SDTA5912XJ4FV","delegating-to-worker-models","Use when you hand off implementation, a plan, research a decision will rely on, or a review, and you brief the worker and check what comes back. A subagent that searches, reads in parallel, or keeps your context small is ordinary tool use. Covers what stays with you, the mechanism, assigning work by strength, the walls preflight, prompts without contradictions, the worker contract and model profiles, evidence from your own run, review, and the fix-up loop.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fdelegating-to-worker-models\u002FSKILL.md",[],[]]