Copilot instructions
.github/instructions/extensions-options.instructions.mdCopilot instructions
Quality
48/100
Scores the file, not the repository.Length
275 words
6 headings · 0 code blocksRepository
18k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.12345# Microsoft.Extensions.Options — Folder-Specific Guidance67## Options Pattern Usage (D8)89- `IOptions<T>` provides a singleton snapshot — use `IOptionsMonitor<T>` when configuration may change at runtime10- `IOptionsSnapshot<T>` is scoped — do not inject it into singleton services (captive dependency)11- Named options must be resolved correctly — validate that the name parameter flows through the entire options pipeline12- Null option names must resolve to `Options.DefaultName`1314## Validation (D8, D13)1516- `ValidateOnStart()` calls must not accumulate duplicate validation registrations — each call should be idempotent17- Use `IValidateOptions<T>` for complex cross-property validation that data annotations cannot express18- Validation source generator output must match the behavior of runtime validation for all supported attributes19- `[Range]`, `[Required]`, and custom validation attributes must be tested with boundary values20- Generated validation code must handle concurrent usage without race conditions (avoid shared mutable state in generated validators)2122## Options Monitor & Change Tracking2324- `IOptionsMonitor<T>.OnChange` notifications must propagate correctly to all subscribers during configuration reload25- Change tracking must not race with concurrent reads — use appropriate synchronization2627## Source Generator Parity (D13)2829- Options validation source generator must produce identical results to the runtime reflection-based validator30- Generated code must handle all edge cases: nullable types, default values, constructor `params` parameters31- Test both generated and runtime validation paths — parity failures are critical bugs3233## Architecture & Layering (D17)3435- Options abstractions (`IOptions<T>`, `IOptionsMonitor<T>`) belong in `Microsoft.Extensions.Options`36- Do not introduce unnecessary new packages — prefer extending existing ones unless layering requires separation37- Package references must target correct and aligned versions38- Changes to options defaults or validation behavior are breaking changes requiring migration guidance3940
Also in dotnet/runtime
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotnet/runtime.github/instructions/system-net-interop.instructions.md · 18k | Copilot instructions | stylearchperformance | 56/100 | 3 days ago | |
| dotnet/runtime.github/instructions/native.instructions.md · 18k | Copilot instructions | lint-formatstylearchperformance | 76/100 | 3 days ago | |
| dotnet/runtime.github/copilot-instructions.md · 18k | Copilot instructions | buildteststylearch+2 | 78/100 | 3 days ago | |
| dotnet/runtime.github/instructions/cdac.instructions.md · 18k | Copilot instructions | typesgitapidocs | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/compression.instructions.md · 18k | Copilot instructions | testlint-formatstylesecurity+1 | 60/100 | 3 days ago | |
| dotnet/runtime.github/instructions/conventions.instructions.md · 18k | Copilot instructions | stylearchagent-behaviourdocs | 56/100 | 3 days ago | |
| dotnet/runtime.github/instructions/core-runtime.instructions.md · 18k | Copilot instructions | styleperformance | 43/100 | 3 days ago | |
| dotnet/runtime.github/instructions/csharp.instructions.md · 18k | Copilot instructions | lint-formatstylearchsecurity+3 | 59/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-caching.instructions.md · 18k | Copilot instructions | styleperformanceagent-behaviour | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-common.instructions.md · 18k | Copilot instructions | styledependencies | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-configuration.instructions.md · 18k | Copilot instructions | no sections | 44/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-di.instructions.md · 18k | Copilot instructions | teststyletesting-strategy | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-hosting.instructions.md · 18k | Copilot instructions | teststyleagent-behaviour | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/extensions-logging.instructions.md · 18k | Copilot instructions | securityperformance | 44/100 | 3 days ago | |
| dotnet/runtime.github/instructions/jit.instructions.md · 18k | Copilot instructions | buildgit | 29/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-common.instructions.md · 18k | Copilot instructions | styledependenciesapi | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-http.instructions.md · 18k | Copilot instructions | styleperformance | 52/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-quic.instructions.md · 18k | Copilot instructions | teststyleperformance | 56/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-security.instructions.md · 18k | Copilot instructions | securityperformancedeployment | 48/100 | 3 days ago | |
| dotnet/runtime.github/instructions/system-net-sockets.instructions.md · 18k | Copilot instructions | styleagent-behaviour | 48/100 | 3 days ago |
Diff against .github/instructions/system-net-interop.instructions.md Diff against .github/instructions/native.instructions.md Diff against .github/copilot-instructions.md Diff against .github/instructions/cdac.instructions.md Diff against .github/instructions/compression.instructions.md Diff against .github/instructions/conventions.instructions.md Diff against .github/instructions/core-runtime.instructions.md Diff against .github/instructions/csharp.instructions.md Diff against .github/instructions/extensions-caching.instructions.md Diff against .github/instructions/extensions-common.instructions.md Diff against .github/instructions/extensions-configuration.instructions.md Diff against .github/instructions/extensions-di.instructions.md Diff against .github/instructions/extensions-hosting.instructions.md Diff against .github/instructions/extensions-logging.instructions.md Diff against .github/instructions/jit.instructions.md Diff against .github/instructions/system-net-common.instructions.md Diff against .github/instructions/system-net-http.instructions.md Diff against .github/instructions/system-net-quic.instructions.md Diff against .github/instructions/system-net-security.instructions.md Diff against .github/instructions/system-net-sockets.instructions.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 3 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| dotnet/roslyn.github/copilot-instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 97/100 | 3 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 3 days ago |
