

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345# General Conventions (all source areas)67Code conventions for any change under `src/`, applied when authoring and when reviewing. Also8apply the language file for the code in question (`csharp`, `native`), `tests` for test changes,9and any matching area file (`core-runtime`, `jit`, `illink`, `system-net-*`, `extensions-*`,10`compression`, `cdac`). Where a more specific file conflicts with a general one, the more11specific file wins.1213Pull-request process — scope, benchmark evidence, API approval, backport — is in14[`copilot-instructions.md`](/.github/copilot-instructions.md). Build and test workflow is in the15`build-and-test` skill. Review-only criteria are in `.github/skills/code-review/pr-assessment.md`.1617## Change Scope & Justification1819- **Prefer the simplest solution that works.** The burden of proof is on the more complex approach. Unnecessary abstraction, extra indirection, and elaborate solutions for marginal gains are a cost, not a feature.20- **Justify each addition.** New code, APIs, abstractions, and flags create a permanent maintenance obligation. If an addition can be avoided without sacrificing correctness or meaningful capability, avoid it.21- **Fix root cause, not symptoms or workarounds.** Investigate and fix the root cause rather than adding workarounds or suppressing warnings. Revert broken commits before layering fixes.22- **Don't bundle unrelated changes.** Keep each change to a single concern: no drive-by refactoring, no whitespace noise, no build artifacts. Large refactorings and mechanical renames belong in their own change, separate from logic changes.2324## Consistency with Codebase Patterns2526### Code Reuse & Deduplication2728- **Extract duplicated logic into shared helper methods.** Fix improvements inside shared helpers so all callers benefit.29- **Move shared code to shared files, not duplicated across runtimes.** When identical code exists across CoreCLR and NativeAOT, move it to the shared partition (using `#if !MONO` if needed).30- **Use existing APIs instead of creating parallel ones.** Before introducing new types, enums, or helpers, check if existing ones serve the same purpose. Fix existing utilities rather than introducing duplicates.31- **Delete dead code and unused declarations aggressively.** Remove dead code, unnecessary wrappers, obsolete fields, and unused variables when encountered or when the only caller changes. Also remove helper methods, enum values, function declarations, and resx strings left unused by a removal.3233### Established Conventions3435- **Store error strings in `.resx`, not inline code.** Reference via the `SR` class. When removing code that uses a resx string, delete the unused string entry.36- **Preserve existing alphabetical ordering in modified lists.** When a PR adds or reorders entries in an alphabetized list—especially items within a `.csproj` item group, such as `Compile`, `ProjectReference`, and `PackageReference`—verify that the changed entries preserve the surrounding order. Flag only ordering regressions introduced by the PR; do not require unrelated cleanup of pre-existing unsorted entries. This also applies to lists of areas, configuration entries, resx entries, entrypoint/export lists, and ref source members.37- **Don't modify auto-generated files or `eng/common` manually.** Change the generator or source definition instead. Files in `eng/common` are synced from dotnet/arcade.38- **Use `DOTNET_` prefix for environment variables, not `COMPlus_`.** New runtime environment variables must use `DOTNET_` exclusively.39- **Match existing style in modified files.** The existing style in a file takes precedence over general guidelines. Do not change existing code for style alone.4041### Runtime-Specific Patterns4243- **Consider NativeAOT parity for runtime changes.** When changing CoreCLR behavior, verify whether the same change is needed for NativeAOT. Note: Mono and CoreCLR native code conventions differ significantly — do not assume they share the same rules.44- **Keep interpreter behavior consistent with the regular JIT.** Follow the same patterns, naming, error codes (`CORJIT_BADCODE`), and macros (`NO_WAY`). Use `FEATURE_INTERPRETER` guards.45- **Source generators: no file locks, diagnostics from analyzers only.** Generators should bypass invalid state gracefully. A separate analyzer should produce diagnostics.46- **Ref assembly conventions.** No `using` directives (fully qualify types), empty method bodies or `throw null`, genapi-style formatting, alphabetical member order. TFM-specific APIs go in separate files.4748## Documentation & Comments4950- **Comments should explain why, not restate code.** Delete comments like `// Get the types` that just duplicate the code in English. Don't include historical context about why code changed.51- **Delete or update obsolete comments when corresponding code changes.** Stale comments describing old behavior are worse than no comments. Update them when you touch the relevant code; leave unrelated stale comments to a dedicated cleanup pass.52- **Track deferred work with GitHub issues and searchable TODOs.** Reference a tracking issue in TODO comments with a consistent prefix (e.g., `TODO-Async:`). Remove ancient TODOs that will never be addressed.53- **Don't duplicate comments on interface implementations.** Documentation comments belong on the interface definition. Implementations should use `<inheritdoc/>` to avoid divergence.54- **Add XML doc comments on all new public APIs.** These seed the official API documentation on learn.microsoft.com. Properties should start with "Gets the ..." or "Gets or sets the ...". Do not add XML docs to test code.55- **Use SHA-specific or commit-based links in documentation.** Don't use branch-relative links that break when files move.56- **Reference specs and authoritative sources in implementation code.** When parsing signatures and metadata, cite the relevant spec section (e.g., ECMA-335). Link to relevant RFCs, papers, or repo-specific documentation (such as the ECMA-335 augments maintained in this repo). This applies broadly, not just to ECMA-335.57- **Use established terminology in user-facing text.** Do not expose internal type names, private field names, or codenames like "Roslyn" in public docs or error messages.58- **Retain copyright headers and license information.** All C# and C++ source files must include the standard license header, including test files. When porting from other projects, retain original copyright and update THIRD-PARTY-NOTICES.TXT.59
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/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-di.instructions.md · 18k | Copilot instructions | teststyletesting-strategy | 52/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 | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 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 | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 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-conventions-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.
Directory