z-dotnet-core

Installation
SKILL.md

.NET core

Default to minimal APIs for a new small service, controllers only where the codebase already committed to them — don't migrate an inherited controller app just to match a green one.

Target framework

  • Select a supported LTS from Microsoft's current support policy for new services. Preserve the target of an inherited application unless an upgrade is in scope.
  • verify against the actual global.json/.csproj TargetFramework before assuming a version — an inherited codebase may sit on an out-of-support release

API style

  • minimal APIs (MapGet/MapPost on WebApplication) for small, focused services — less ceremony, faster to read top to bottom
  • controllers where the codebase already has them — don't rewrite a working controller-based API to minimal APIs on style preference alone
  • nullable reference types enabled (<Nullable>enable</Nullable>) with warnings treated as errors — this is what makes a null a compile-time signal instead of a runtime surprise

Dependency injection

  • Use constructor injection for services and supported handler-parameter injection for minimal APIs. Do not hide dependencies behind IServiceProvider.GetService in business logic.
  • register lifetimes deliberately: Scoped for anything touching a DbContext or per-request state, Singleton only for genuinely stateless or thread-safe services, Transient for cheap short-lived instances
Installs
10
First Seen
Aug 29, 2026