Skip to content
wshaddix avatar

Microsoft Extensions Dependency Injection

Extension-method composition for grouping .NET DI registrations, with production configuration reusable in tests.

CCM score
45 of 100
skills.sh installs
557
GitHub stars
94
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers grouping related registrations into Add{Feature}Services() extension methods so Program.cs composes subsystems instead of listing hundreds of lines
  • Includes a file convention ({Feature}ServiceCollectionExtensions.cs) placed beside each feature's services, plus a naming table for Add, Configure, and Use methods
  • Shows configuration binding with AddOptions, ValidateDataAnnotations, and ValidateOnStart within an extension method
  • Designed for ASP.NET Core and Akka.NET teams that need production registrations reused in WebApplicationFactory and TestKit tests

Install

$ npx -y skills add wshaddix/dotnet-skills --skill microsoft-extensions-dependency-injection -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Dependency Injection Patterns

When to Use This Skill

Use this skill when:

  • Organizing service registrations in ASP.NET Core applications
  • Avoiding massive Program.cs/Startup.cs files with hundreds of registrations
  • Making service configuration reusable between production and tests
  • Designing libraries that integrate with Microsoft.Extensions.DependencyInjection

The Problem

Without organization, Program.cs becomes unmanageable:

// BAD: 200+ lines of unorganized registrations
var builder = WebApplication.CreateBuilder(args);

Details

Repository
github.com/wshaddix/dotnet-skills
Categories
.NET & C#, Backend & APIs
First seen
Jun 3, 2026

More from wshaddix/dotnet-skills

All 13

Similar to Microsoft Extensions Dependency Injection

More .NET & C#