

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345# Microsoft.Extensions.DependencyInjection — Folder-Specific Guidance67## Service Lifetime Correctness (D7)89- Use `TryAdd{Lifetime}` instead of `Add{Lifetime}` for default registrations to avoid overriding user-configured services10- Scoped services must never be injected into singleton services (captive dependency) — the scoped service would live for the application lifetime11- Transient IDisposable services are tracked by the container until scope disposal — prefer scoped lifetime for disposable services12- Service registration order matters — later registrations of the same type override earlier ones unless `TryAdd` is used13- Decorator patterns where inner and outer service share the same interface must guard against infinite recursion during resolution14- Do not inject `IServiceProvider` broadly as a service locator — inject the specific service needed1516## Service Resolution1718- `ActivatorUtilities.CreateInstance` bypasses the container registration or factory for the type being created, but it still resolves constructor dependencies through the provided `IServiceProvider`, which can invoke factories for those dependencies19- Singleton dependencies resolved lazily at first request must not cause response-time spikes — consider `ValidateOnStart`20- Factory delegates (`Func<IServiceProvider, T>`) should follow established parameter ordering conventions2122## Abstractions Package (D17)2324- `IServiceCollection`, `IServiceProvider`, and related interfaces belong in `Microsoft.Extensions.DependencyInjection.Abstractions`25- The concrete `ServiceProvider` and resolution engine belong in the implementation package26- Moving types between abstractions and implementation is a breaking change27- Package references must target correct and aligned versions across the dependency graph2829## Thread Safety (D6)3031- Singleton services are accessed concurrently by default — all singleton implementations must be thread-safe3233## Trim & AOT (D14)3435- Annotate service resolution that uses reflection with `[DynamicallyAccessedMembers]`36- Ensure the DI container works correctly under NativeAOT — test with `PublishAot=true`37- No new IL2xxx trim warnings without explicit justification3839## Test Coverage (D10)4041- Every bug fix includes a regression test; every new feature has happy-path and edge/error tests42- Dispose behavior must be tested — verify resources are released and post-disposal operations throw `ObjectDisposedException`43- Test captive dependency detection and resolution order across different registration patterns4445
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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotnet/runtime.github/copilot-instructions.md · 18k | Copilot instructions | buildteststylearch+2 | 78/100 | 14 days ago | |
| dotnet/runtime.github/instructions/cdac.instructions.md · 18k | Copilot instructions | typesgitapidocs | 52/100 | 14 days ago | |
| dotnet/runtime.github/instructions/compression.instructions.md · 18k | Copilot instructions | testlint-formatstylesecurity+1 | 60/100 | 14 days ago | |
| dotnet/runtime.github/instructions/conventions.instructions.md · 18k | Copilot instructions | stylearchagent-behaviourdocs | 56/100 | 7 days ago | |
| dotnet/runtime.github/instructions/core-runtime.instructions.md · 18k | Copilot instructions | styleperformance | 43/100 | 14 days ago | |
| dotnet/runtime.github/instructions/csharp.instructions.md · 18k | Copilot instructions | lint-formatstylearchsecurity+3 | 59/100 | 7 days ago | |
| dotnet/runtime.github/instructions/extensions-caching.instructions.md · 18k | Copilot instructions | styleperformanceagent-behaviour | 48/100 | 14 days ago | |
| dotnet/runtime.github/instructions/extensions-common.instructions.md · 18k | Copilot instructions | styledependencies | 48/100 | 14 days ago | |
| dotnet/runtime.github/instructions/extensions-configuration.instructions.md · 18k | Copilot instructions | no sections | 44/100 | 14 days ago | |
| dotnet/runtime.github/instructions/extensions-hosting.instructions.md · 18k | Copilot instructions | teststyleagent-behaviour | 52/100 | 14 days ago | |
| dotnet/runtime.github/instructions/extensions-logging.instructions.md · 18k | Copilot instructions | securityperformance | 44/100 | 14 days ago | |
| dotnet/runtime.github/instructions/extensions-options.instructions.md · 18k | Copilot instructions | style | 48/100 | 14 days ago | |
| dotnet/runtime.github/instructions/illink.instructions.md · 18k | Copilot instructions | no sections | 16/100 | 7 days ago | |
| dotnet/runtime.github/instructions/jit.instructions.md · 18k | Copilot instructions | buildgit | 29/100 | 14 days ago | |
| dotnet/runtime.github/instructions/system-net-common.instructions.md · 18k | Copilot instructions | styledependenciesapi | 48/100 | 14 days ago | |
| dotnet/runtime.github/instructions/system-net-interop.instructions.md · 18k | Copilot instructions | stylearchperformance | 56/100 | 14 days ago | |
| dotnet/runtime.github/instructions/system-net-quic.instructions.md · 18k | Copilot instructions | teststyleperformance | 56/100 | 14 days ago | |
| dotnet/runtime.github/instructions/system-net-sockets.instructions.md · 18k | Copilot instructions | styleagent-behaviour | 48/100 | 14 days ago | |
| dotnet/runtime.github/instructions/system-security-cryptography.instructions.md · 18k | Copilot instructions | stylesecurity | 48/100 | 8 days ago | |
| dotnet/runtimeeng/common/AGENTS.md · 18k | AGENTS.md | no sections | 4/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 7 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/dotnet-runtime-github-instructions-extensions-di-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.