What problem does it solve?
Writing code for Microsoft.Extensions.* and System.IO.Compression libraries involves subtle pitfalls like captive dependencies, incorrect DI lifetimes, blocking async compression, and trim/AOT incompatibilities that are easy to miss without deep framework knowledge.
Core Features & Use Cases
- DI Lifetime Guidance: Decision trees for choosing Singleton, Scoped, or Transient lifetimes and avoiding captive dependencies with IServiceScopeFactory.
- Configuration, Options & Logging Patterns: Covers configuration binding with validation, IValidateOptions implementations, and high-performance logging via the [LoggerMessage] source generator.
- Compression & Caching Guidance: Proper async compression with BrotliStream, ZipArchive extraction preserving Unix permissions, and stampede-safe caching with HybridCache.
- Use Case: When adding a new hosted service to dotnet/runtime, use this Skill to implement a safe BackgroundService with graceful shutdown, register it with TryAdd patterns, and verify trim/AOT safety before submitting.
Quick Start
Ask the AI to review or write Microsoft.Extensions dependency injection code following the extensions-review guidance for dotnet/runtime.