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.
npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/microsoft-extensions-configuration/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/microsoft-extensions-configuration/
1Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a codex2Manually: put the files in place
.agents/skills/microsoft-extensions-configuration/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a cursor2Manually: put the files in place
.cursor/skills/microsoft-extensions-configuration/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshaddix/dotnet-skills microsoft-extensions-configuration2Manually: put the files in place
.github/skills/microsoft-extensions-configuration/SKILL.md1Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a gemini-cli2Platform CLI
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/microsoft-extensions-configurationManually: put the files in place
.devin/skills/microsoft-extensions-configuration/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add wshaddix/dotnet-skills --skill microsoft-extensions-configuration -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.