RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Copilot instructions/dotnet/runtime

Copilot instructions

.github/instructions/extensions-options.instructions.md
Copilot instructions

Quality

48/100

Scores the file, not the repository.

Length

275 words

6 headings · 0 code blocks

Repository

18k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
dotnet/runtime/.github/instructions/extensions-options.instructions.mdRawGitHub
1---
2applyTo: "src/libraries/Microsoft.Extensions.Options*/**"
3---
4 
5# Microsoft.Extensions.Options — Folder-Specific Guidance
6 
7## Options Pattern Usage (D8)
8 
9- `IOptions<T>` provides a singleton snapshot — use `IOptionsMonitor<T>` when configuration may change at runtime
10- `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 pipeline
12- Null option names must resolve to `Options.DefaultName`
13 
14## Validation (D8, D13)
15 
16- `ValidateOnStart()` calls must not accumulate duplicate validation registrations — each call should be idempotent
17- Use `IValidateOptions<T>` for complex cross-property validation that data annotations cannot express
18- Validation source generator output must match the behavior of runtime validation for all supported attributes
19- `[Range]`, `[Required]`, and custom validation attributes must be tested with boundary values
20- Generated validation code must handle concurrent usage without race conditions (avoid shared mutable state in generated validators)
21 
22## Options Monitor & Change Tracking
23 
24- `IOptionsMonitor<T>.OnChange` notifications must propagate correctly to all subscribers during configuration reload
25- Change tracking must not race with concurrent reads — use appropriate synchronization
26 
27## Source Generator Parity (D13)
28 
29- Options validation source generator must produce identical results to the runtime reflection-based validator
30- Generated code must handle all edge cases: nullable types, default values, constructor `params` parameters
31- Test both generated and runtime validation paths — parity failures are critical bugs
32 
33## Architecture & Layering (D17)
34 
35- 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 separation
37- Package references must target correct and aligned versions
38- Changes to options defaults or validation behavior are breaking changes requiring migration guidance
39 
40 

Sections

  • Microsoft.Extensions.Options — Folder-Specific Guidance
  • Options Pattern Usage (D8)
  • Validation (D8, D13)
  • Options Monitor & Change Tracking
  • Source Generator Parity (D13)
  • Architecture & Layering (D17)

What it covers

code-style

Stack — with the evidence

csharp

(1.00)

dotnet

(1.00)

node

(0.70)

eslint

(0.70)

typescript

(0.60)

github-actions

(0.60)

javascript

(0.50)

Glob targeting

  • src/libraries/Microsoft.Extensions.Options*/**

Format

Copilot instructions

Two layers: one always-on repo file, plus optional glob-scoped instruction files. Lives under .github/ rather than the repo root, which is the tell that it is aimed at the GitHub platform surface as much as the editor.

What the corpus says about it

Repository

Owner
dotnet
Language
—
License
—
Archived
no

All configs in this repo

Also in dotnet/runtime

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
dotnet/runtime.github/instructions/system-net-interop.instructions.md · 18kCopilot instructionscsharpdotnet+5stylearchperformance56/1003 days ago
dotnet/runtime.github/instructions/native.instructions.md · 18kCopilot instructionscsharpdotnet+5lint-formatstylearchperformance76/1003 days ago
dotnet/runtime.github/copilot-instructions.md · 18kCopilot instructionscsharpdotnet+5buildteststylearch+278/1003 days ago
dotnet/runtime.github/instructions/cdac.instructions.md · 18kCopilot instructionscsharpdotnet+5typesgitapidocs52/1003 days ago
dotnet/runtime.github/instructions/compression.instructions.md · 18kCopilot instructionscsharpdotnet+5testlint-formatstylesecurity+160/1003 days ago
dotnet/runtime.github/instructions/conventions.instructions.md · 18kCopilot instructionscsharpdotnet+5stylearchagent-behaviourdocs56/1003 days ago
dotnet/runtime.github/instructions/core-runtime.instructions.md · 18kCopilot instructionscsharpdotnet+5styleperformance43/1003 days ago
dotnet/runtime.github/instructions/csharp.instructions.md · 18kCopilot instructionscsharpdotnet+5lint-formatstylearchsecurity+359/1003 days ago
dotnet/runtime.github/instructions/extensions-caching.instructions.md · 18kCopilot instructionscsharpdotnet+5styleperformanceagent-behaviour48/1003 days ago
dotnet/runtime.github/instructions/extensions-common.instructions.md · 18kCopilot instructionscsharpdotnet+5styledependencies48/1003 days ago
dotnet/runtime.github/instructions/extensions-configuration.instructions.md · 18kCopilot instructionscsharpdotnet+5no sections44/1003 days ago
dotnet/runtime.github/instructions/extensions-di.instructions.md · 18kCopilot instructionscsharpdotnet+5teststyletesting-strategy52/1003 days ago
dotnet/runtime.github/instructions/extensions-hosting.instructions.md · 18kCopilot instructionscsharpdotnet+5teststyleagent-behaviour52/1003 days ago
dotnet/runtime.github/instructions/extensions-logging.instructions.md · 18kCopilot instructionscsharpdotnet+5securityperformance44/1003 days ago
dotnet/runtime.github/instructions/jit.instructions.md · 18kCopilot instructionscsharpdotnet+5buildgit29/1003 days ago
dotnet/runtime.github/instructions/system-net-common.instructions.md · 18kCopilot instructionscsharpdotnet+5styledependenciesapi48/1003 days ago
dotnet/runtime.github/instructions/system-net-http.instructions.md · 18kCopilot instructionscsharpdotnet+5styleperformance52/1003 days ago
dotnet/runtime.github/instructions/system-net-quic.instructions.md · 18kCopilot instructionscsharpdotnet+5teststyleperformance56/1003 days ago
dotnet/runtime.github/instructions/system-net-security.instructions.md · 18kCopilot instructionscsharpdotnet+5securityperformancedeployment48/1003 days ago
dotnet/runtime.github/instructions/system-net-sockets.instructions.md · 18kCopilot instructionscsharpdotnet+5styleagent-behaviour48/1003 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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17Copilot instructionsnodejavascriptsetupbuildtestlint-format+7100/1003 days ago
chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63Copilot instructionstypescriptreact+7buildlint-formatstylearch+4100/1003 days ago
louislam/uptime-kuma.github/copilot-instructions.md · 90kCopilot instructionstypescriptjavascript+10setupbuildtestlint-format+9100/1003 days ago
dotnet/roslyn.github/instructions/Compiler.instructions.md · 21kCopilot instructionscsharpdotnet+1buildteststylearch+399/1003 days ago
bagisto/bagisto.github/copilot-instructions.md · 28kCopilot instructionsphplaravel+8setupbuildteststyle+597/1003 days ago
JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31kCopilot instructionstypescriptnode+7buildlint-formatstylearch+397/1002 days ago
dotnet/roslyn.github/copilot-instructions.md · 21kCopilot instructionscsharpdotnet+1buildteststylearch+397/1003 days ago
nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32Copilot instructionstypescriptnode+8setupbuildtestlint-format+1196/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack