Skip to main content
skill CX Codex

microsoft-extensions-configuration · wshaddix — Claude Code skill for .NET config

A skill for Microsoft.Extensions.Configuration: binding settings to classes, startup validation, and IOptions patterns.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a claude-code
Open on GitHub

What microsoft-extensions-configuration does

This skill walks the agent through configuration patterns in .NET apps. It covers binding an appsettings.json section to a strongly-typed class with BindConfiguration, turning on attribute validation, and writing a custom IValidateOptions<T> validator.

Startup validation gets its own section. Without .ValidateOnStart() the checks only fire the first time someone reads the options, so a bad connection string surfaces deep in production code. The skill lays out the order: Data Annotations first, then custom validators, with every failure collected into one list.

There are examples of validators that pull dependencies from DI, such as a logger and the host environment. The material stops partway through the database settings validator, so treat the rest as unfinished. You need a .NET project with the Microsoft.Extensions.Options package.

What it helps with

  • bind an appsettings.json section to a typed settings class
  • validate configuration at startup and fail with a readable error
  • write a validator that takes a logger and environment from DI
  • tell IOptions, IOptionsSnapshot and IOptionsMonitor apart
  • collect every configuration error into one report instead of crashing mid-request

Example prompts for the agent

  • show me how to bind SmtpSettings from appsettings.json and validate it on startup
  • write an IValidateOptions for DatabaseSettings that checks the connection string
  • why does my validation never run when the app starts?

How to install microsoft-extensions-configuration

1Skills CLI (Vercel)

npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a claude-code

2Manually: put the files in place

~/.claude/skills/microsoft-extensions-configuration/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/microsoft-extensions-configuration/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about microsoft-extensions-configuration

How do I install microsoft-extensions-configuration in Claude?

Run npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a claude-code. The skill file lands at ~/.claude/skills/microsoft-extensions-configuration/SKILL.md.

What does microsoft-extensions-configuration do?

It gives the agent Microsoft.Extensions.Configuration patterns: options binding, Data Annotations and IValidateOptions validation, and consuming IOptions in services.

Why validate at startup?

So the app fails immediately with a clear message instead of throwing later inside business logic. Add .ValidateOnStart() to the options registration to get that.

Similar skills

Everything for Backend and APIs →

microsoft-extensions-configuration by other authors comes first.

From the same set5

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor