What problem does it solve?
Dependency injection misconfigurations cause subtle runtime bugs, memory leaks, and incorrect behavior when service lifetimes are mismatched or registrations are inconsistent. This Skill helps you reason about service lifetimes, avoid captive dependencies, and choose the right patterns for composition and resolution in modern .NET projects.
Core Features & Use Cases
- Lifetime guidance: Clear rules to match singleton, scoped, and transient lifetimes and avoid capturing scoped services in singletons.
- Patterns and resolution: Recommendations and examples for keyed services, decorator pattern, factory delegates, and convention-based registration using Scrutor.
- Configuration and options: Best practices for registering strongly-typed configuration, validating on start, and injecting options safely.
- Use case: When reviewing service registrations in a .NET 10 application, it helps identify lifetime mismatches, propose decorator wiring for cross-cutting concerns, and convert factory logic to keyed services where appropriate.
Quick Start
Ask the skill to analyze your service registrations, fix lifetime mismatches, and recommend keyed services, decorators, or convention-based registrations.