What problem does it solve?
Prevents common ASP.NET Core mistakes such as incorrect dependency injection lifetimes, improper HttpClient usage that leads to socket exhaustion, inconsistent API response formats, and missing API versioning that causes breaking changes and maintenance burden.
Core Features & Use Cases
- DI Lifetime Guidance: Recommends Singleton/Scoped/Transient usage patterns and warns about captive dependencies and injecting scoped services into singletons.
- HttpClient Safety: Enforces IHttpClientFactory or typed/named clients instead of creating HttpClient instances per request.
- Response Consistency & Versioning: Mandates ProblemDetails-based error responses and respects project API versioning settings when generating or modifying endpoints.
- Configuration & Background Services: Promotes the Options Pattern for typed configuration and correct BackgroundService/IHostedService registration patterns.
- Use Case: When adding a new controller or refactoring services, the skill audits registrations, suggests lifetime changes, enforces HttpClient factory usage, and ensures error responses follow RFC 7807.
Quick Start
Apply the csharp-aspnetcore skill to audit the current repository for DI lifetimes, HttpClient usage, response formatting, options pattern usage, and API versioning and provide actionable recommendations.