microsoft-extensions-configuration
Microsoft.Extensions.Options patterns including IValidateOptions, strongly-typed settings, validation on startup, and the Options pattern for clean…
Skill by ComeOnOliver
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/comeonoliver-microsoft-extensions-configuration
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/microsoft-extensions-configuration
What's inside
- Skill name
microsoft-extensions-configuration- Description
- Microsoft.Extensions.Options patterns including IValidateOptions, strongly-typed settings, validation on startup, and the Options pattern for clean configuration management.
- License
- MIT
- Instructions
- 340 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Microsoft.Extensions Configuration Patterns
## When to Use This Skill
Use this skill when:
- Binding configuration from appsettings.json to strongly-typed classes
- Validating configuration at application startup (fail fast)
- Implementing complex validation logic for settings
- Designing configuration classes that are testable and maintainable
- Understanding IOptions<T>, IOptionsSnapshot<T>, and IOptionsMonitor<T>
## Reference Files
- [advanced-patterns.md](advanced-patterns.md): Validators with dependencies, named options, complete production example (AkkaSettings), and testing validators
## Why Configuration Validation Matters
**The Problem:** Applications often fail at runtime due to misconfiguration - missing connection strings, invalid URLs, out-of-range values. These failures happen deep in business logic, far from where configuration is loaded.
**The Solution:** Validate configuration at startup. If invalid, fail immediately with a clear error message.
```csharp
// BAD: Fails at runtime when someone tries to use the service
public class EmailService
{
public EmailService(IOptions<SmtpSettings> options)
{
var settings = options.Value;
// Throws NullReferenceException 10 minutes into production
_client = new SmtpClient(settings.Host, settings.Port);
}
}
// GOOD: Fails at startup with clear error
// "SmtpSettings validation failed: Host is required"
```
---
## Pattern 1: Basic Options Binding
### Define a Settings Class
```csharp
public class SmtpSettings
{
public const string SectionName = "Smtp";
public string Host { get; set; } = string.Empty;
public int Port { get; set; } = 587;
public string? Username { get; set; }
public string? Password { get; set; }
public bool UseSsl { get; set; } = true;
}
```
### Bind from Configuration
```csharp
builder.Services.AddOptions<SmtpSettings>()
.BindConfiguration(SmtpSettings.SectionName);
// appsettings.json
{
"Smtp": {
"Host": "smtp.example.com",
"Port": 587,
"Username": "user@example.com",
"Password": "secret",
"UseSsl": true
}
}
```
### Consume in Services
```csharp
public class EmailService
{
private readonly SmtpSettings _settings;
// IOptions<T> - singleton, read once at startup
public EmailService(IOptions<SmtpSettings> options)
{
_settings = options.Value;
}
}
```
---
## Pattern 2: Data Annotations Validation
For simple validation rules, use Data Annotations:
```csharp
using System.ComponentModel.DataAnnotations;
public class SmtpSettings
{
public const string SectionName = "Smtp";
[Required(ErrorMessage = "SMTP host is required")]
public string Host { get; set; } = string.Empty;
[Range(1, 65535, ErrorMessage = "Port must be between 1 and 65535")]
public int Port { get; set; } = 587;
[EmailAddress(ErrorMessage = "Username must be a valid email address")]
public string? Username { get; set; }
public string? Password { get; set; }
public bool UseSsl { get; set; } = true;
}
```
### Enable Data Annotations Validation
```csharpFrom ComeOnOliver/skillshub, MIT.
More from ComeOnOliver/skillshub
- 0.512score
solidity-coding
ComeOnOliver
[AUTO-INVOKE] MUST be invoked BEFORE writing or modifying any Solidity contract (.sol files).
SkillDFreshness: D★ 64Claude Code +9 - 0.512score
solidity-debug
ComeOnOliver
[AUTO-INVOKE] MUST be invoked when debugging failed on-chain transactions.
SkillDFreshness: D★ 64Claude Code +9 - 0.512score
ilspy-decompile
ComeOnOliver
Understand implementation details of .NET code by decompiling assemblies.
SkillDFreshness: D★ 64Claude Code +9 - 0.512score
solidity-audit
ComeOnOliver
Security audit and code review checklist.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
crap-analysis
ComeOnOliver
Analyze code coverage and CRAP (Change Risk Anti-Patterns) scores to identify high-risk code.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
claude-code-usage
ComeOnOliver
[AUTO-INVOKE] MUST be invoked at the START of each new coding session.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
playwright-ci-caching
ComeOnOliver
Cache Playwright browser binaries in CI/CD pipelines (GitHub Actions, Azure DevOps) to avoid 1-2 minute download overhead on every build.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
solidity-deploy
ComeOnOliver
[AUTO-INVOKE] MUST be invoked BEFORE deploying contracts or writing deployment scripts (*.s.sol).
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
mjml-email-templates
ComeOnOliver
Build responsive email templates using MJML markup language.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
aspire-service-defaults
ComeOnOliver
Create a shared ServiceDefaults project for Aspire applications.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
defi-security
ComeOnOliver
[AUTO-INVOKE] MUST be invoked BEFORE deploying DeFi contracts (DEX, lending, staking, LP, token).
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
dotnet-devcert-trust
ComeOnOliver
Diagnose and fix .NET HTTPS dev certificate trust issues on Linux.
SkillDFreshness: D★ 64Claude Code +9
Signals
- Stars
- 64
- Forks
- 24
- Open issues
- 30
- Last commit (this folder)
- Mar 23, 2026 (7 months ago)
- Last release
- Apr 3, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ComeOnOliver/skillshub
- Website
- skillshub.wtf
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ComeOnOliver
- 0.512score
ilspy-decompile
ComeOnOliver
Understand implementation details of .NET code by decompiling assemblies.
SkillDFreshness: D★ 64Claude Code +9 - 0.512score
solidity-audit
ComeOnOliver
Security audit and code review checklist.
SkillDFreshness: D★ 64Claude Code +9 - 0.512score
solidity-debug
ComeOnOliver
[AUTO-INVOKE] MUST be invoked when debugging failed on-chain transactions.
SkillDFreshness: D★ 64Claude Code +9 - 0.512score
solidity-coding
ComeOnOliver
[AUTO-INVOKE] MUST be invoked BEFORE writing or modifying any Solidity contract (.sol files).
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
claude-code-usage
ComeOnOliver
[AUTO-INVOKE] MUST be invoked at the START of each new coding session.
SkillDFreshness: D★ 64Claude Code +9 - 0.509score
solidity-deploy
ComeOnOliver
[AUTO-INVOKE] MUST be invoked BEFORE deploying contracts or writing deployment scripts (*.s.sol).
SkillDFreshness: D★ 64Claude Code +9
Cite this page
microsoft-extensions-configuration skill. Agent Mart. https://agentmart.dev/skills/comeonoliver-microsoft-extensions-configuration (last updated 2026-10-24)