Skip to main content
dotnet-strict Apply strict .NET/C# coding standards to a project or solution. Adds Roslynator and Meziantou analyzers, a comprehensive .editorconfig with 80+ diagnostic rules, naming conventions, and performance warnings. Use when the user wants to enforce strict code quality, set up analyzers, or add an .editorconfig to a .NET project.
Zur Installation springen Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/asynkron/asynkron-skills --skill dotnet-strictDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Basierend auf der SOC-Berufsklassifikation
name dotnet-strict description Apply strict .NET/C# coding standards to a project or solution. Adds Roslynator and Meziantou analyzers, a comprehensive .editorconfig with 80+ diagnostic rules, naming conventions, and performance warnings. Use when the user wants to enforce strict code quality, set up analyzers, or add an .editorconfig to a .NET project. disable-model-invocation true argument-hint [solution or project path]
What This Does
Applies a strict, production-grade coding standard to a .NET project by:
Adding analyzer NuGet packages to the project(s)
Creating a comprehensive .editorconfig at the solution root
Verifying the setup compiles
Step 1: Determine Target
If $ARGUMENTS is provided, use it as the solution/project path. Otherwise, look for a .sln or .csproj in the current directory.
Identify all .csproj files that should get analyzers (typically src/ projects, not test projects).
Step 2: Add Analyzer Packages
Add these analyzer packages to each source project (not test projects):
dotnet add <project.csproj> package Roslynator.Analyzers
dotnet add <project.csproj> package Meziantou.Analyzer
These should be added as development-only dependencies. After adding, verify the package references include PrivateAssets="all" so they don't flow to consumers:
<PackageReference Include ="Roslynator.Analyzers" Version ="*" >
<PrivateAssets > all</PrivateAssets >
<IncludeAssets > runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
</PackageReference >
<PackageReference Include ="Meziantou.Analyzer" Version ="*" >
<PrivateAssets > all</PrivateAssets >
<IncludeAssets > runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
</PackageReference >
Step 3: Create .editorconfig
Create a .editorconfig file at the solution root (next to the .sln file, or at the repo root). If one already exists, merge the rules — do not overwrite existing customizations.
The .editorconfig should contain the following rules:
root = true
[*]
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.cs]
indent_size = 4
dotnet_sort_system_directives_first = true
dotnet_style_qualification_for_field = false :suggestion
dotnet_style_qualification_for_property = false :suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true :warning
dotnet_style_predefined_type_for_member_access = true :warning
csharp_style_var_for_built_in_types = true :warning
csharp_style_var_when_type_is_apparent = true :warning
csharp_style_var_elsewhere = true :suggestion
csharp_style_throw_expression = false :suggestion
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
=
=
= file_scoped
=
= public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:suggestion
=
= warning
= non_public
= suggestion
= constant_fields
= pascal_case_style
= field
= const
= pascal_case
= suggestion
= static_fields
= pascal_case_style
=
= field
= public, private, internal
= static
= suggestion
= private_internal_fields
= camel_case_underscore_style
=
= field
= private, internal
= _
= camel_case
= warning
= error
= none
= none
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= none
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= suggestion
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= private, internal
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= error
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= suggestion
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
= warning
=
=
=
= lf
= silent
Step 4: Build and Verify
dotnet build <solution-or-project>
The first build after adding analyzers will likely produce many warnings. This is expected — it shows the analyzers are working.
Report a summary of the warnings found, grouped by category:
How many performance warnings (CA18xx)
How many unused code warnings (RCS1163, RCS1213, CA1811, etc.)
How many style warnings (IDE0xxx)
How many Meziantou warnings (MA0xxx)
Step 5: Optional — Auto-fix
Suggest running roslynator to auto-fix what it can:
roslynator fix <solution-or-project>
What the Rules Cover
Performance (CA18xx): Use Span/Memory over substring, prefer Count property over Count(), use char overloads, seal internal types, prefer TryGetValue, avoid zero-length arrays.
Dead Code (RCS1163, RCS1213, CA1811, IDE0051): Unused parameters, unused type parameters, unused members, uncalled private code.
Correctness (CA2xxx): Rethrow to preserve stack, don't raise reserved exceptions, forward CancellationToken, avoid infinite recursion, use ValueTask correctly.
Culture Safety (MA0074, MA0006, CA1305): Avoid implicit culture-sensitive methods, use String.Equals, specify IFormatProvider.
Modern C# Style: File-scoped namespaces, pattern matching, null propagation, coalesce expressions, var everywhere, braces always.
Naming: Constants PascalCase, static fields PascalCase, private fields _camelCase.
csharp_new_line_before_members_in_object_initializers
true
csharp_new_line_before_members_in_anonymous_types
true
csharp_style_namespace_declarations
csharp_prefer_braces
true
csharp_preferred_modifier_order
dotnet_style_allow_multiple_blank_lines_experimental
false
dotnet_diagnostic.IDE2000.severity
dotnet_code_quality_unused_parameters
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols
dotnet_naming_rule.constant_fields_should_be_pascal_case.style
dotnet_naming_symbols.constant_fields.applicable_kinds
dotnet_naming_symbols.constant_fields.required_modifiers
dotnet_naming_style.pascal_case_style.capitalization
dotnet_naming_rule.pascal_case_for_static_fields.severity
dotnet_naming_rule.pascal_case_for_static_fields.symbols
dotnet_naming_rule.pascal_case_for_static_fields.style
dotnet_naming_rule.pascal_case_for_static_fields.priority
1
dotnet_naming_symbols.static_fields.applicable_kinds
dotnet_naming_symbols.static_fields.applicable_accessibilities
dotnet_naming_symbols.static_fields.required_modifiers
dotnet_naming_rule.camel_case_for_private_internal_fields.severity
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols
dotnet_naming_rule.camel_case_for_private_internal_fields.style
dotnet_naming_rule.camel_case_for_private_internal_fields.priority
3
dotnet_naming_symbols.private_internal_fields.applicable_kinds
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities
dotnet_naming_style.camel_case_underscore_style.required_prefix
dotnet_naming_style.camel_case_underscore_style.capitalization
dotnet_diagnostic.RCS1261.severity
dotnet_diagnostic.RCS1093.severity
dotnet_diagnostic.RCS1194.severity
dotnet_diagnostic.RCS1123.severity
dotnet_diagnostic.RCS1163.severity
dotnet_diagnostic.RCS1164.severity
dotnet_diagnostic.RCS1175.severity
dotnet_diagnostic.RCS1213.severity
dotnet_diagnostic.MA0099.severity
dotnet_diagnostic.MA0084.severity
dotnet_diagnostic.MA0015.severity
dotnet_diagnostic.MA0051.severity
dotnet_diagnostic.MA0006.severity
dotnet_diagnostic.MA0074.severity
dotnet_diagnostic.MA0002.severity
dotnet_diagnostic.IDE0005.severity
dotnet_diagnostic.IDE0011.severity
dotnet_diagnostic.IDE0020.severity
dotnet_diagnostic.IDE0029.severity
dotnet_diagnostic.IDE0030.severity
dotnet_diagnostic.IDE0031.severity
dotnet_diagnostic.IDE0035.severity
dotnet_diagnostic.IDE0036.severity
dotnet_diagnostic.IDE0038.severity
dotnet_diagnostic.IDE0043.severity
dotnet_diagnostic.IDE0044.severity
dotnet_diagnostic.IDE0051.severity
dotnet_diagnostic.IDE0055.severity
dotnet_diagnostic.IDE0059.severity
dotnet_diagnostic.IDE0062.severity
dotnet_diagnostic.IDE0161.severity
dotnet_diagnostic.IDE0200.severity
dotnet_diagnostic.CS0162.severity
dotnet_diagnostic.CS0169.severity
dotnet_diagnostic.CA1822.severity
dotnet_code_quality.CA1822.api_surface
dotnet_diagnostic.CA1825.severity
dotnet_diagnostic.CA1826.severity
dotnet_diagnostic.CA1827.severity
dotnet_diagnostic.CA1828.severity
dotnet_diagnostic.CA1829.severity
dotnet_diagnostic.CA1830.severity
dotnet_diagnostic.CA1831.severity
dotnet_diagnostic.CA1832.severity
dotnet_diagnostic.CA1833.severity
dotnet_diagnostic.CA1834.severity
dotnet_diagnostic.CA1835.severity
dotnet_diagnostic.CA1836.severity
dotnet_diagnostic.CA1837.severity
dotnet_diagnostic.CA1838.severity
dotnet_diagnostic.CA1839.severity
dotnet_diagnostic.CA1840.severity
dotnet_diagnostic.CA1841.severity
dotnet_diagnostic.CA1842.severity
dotnet_diagnostic.CA1843.severity
dotnet_diagnostic.CA1844.severity
dotnet_diagnostic.CA1845.severity
dotnet_diagnostic.CA1846.severity
dotnet_diagnostic.CA1847.severity
dotnet_diagnostic.CA1852.severity
dotnet_diagnostic.CA1854.severity
dotnet_diagnostic.CA1855.severity
dotnet_diagnostic.CA1856.severity
dotnet_diagnostic.CA1857.severity
dotnet_diagnostic.CA1858.severity
dotnet_diagnostic.CA1801.severity
dotnet_diagnostic.CA1811.severity
dotnet_diagnostic.CA1823.severity
dotnet_diagnostic.CA1802.severity
dotnet_diagnostic.CA1805.severity
dotnet_diagnostic.CA1810.severity
dotnet_diagnostic.CA1821.severity
dotnet_diagnostic.CA1018.severity
dotnet_diagnostic.CA1047.severity
dotnet_diagnostic.CA1305.severity
dotnet_diagnostic.CA1507.severity
dotnet_diagnostic.CA1510.severity
dotnet_diagnostic.CA1511.severity
dotnet_diagnostic.CA1512.severity
dotnet_diagnostic.CA1513.severity
dotnet_diagnostic.CA1725.severity
dotnet_diagnostic.CA2008.severity
dotnet_diagnostic.CA2009.severity
dotnet_diagnostic.CA2011.severity
dotnet_diagnostic.CA2012.severity
dotnet_diagnostic.CA2013.severity
dotnet_diagnostic.CA2014.severity
dotnet_diagnostic.CA2016.severity
dotnet_diagnostic.CA2022.severity
dotnet_diagnostic.CA2200.severity
dotnet_diagnostic.CA2201.severity
dotnet_diagnostic.CA2208.severity
dotnet_diagnostic.CA2245.severity
dotnet_diagnostic.CA2246.severity
dotnet_diagnostic.CA2249.severity
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
indent_size
2
[*.json]
indent_size
2
[*.sh]
indent_size
4
end_of_line
[tests/**/*.cs]
dotnet_diagnostic.CS9107.severity
Mehr aus diesem Repository Evaluate and improve an API by inventing real, valuable tasks, attempting them through the public API, measuring the usefulness of its features and data, and turning failures into verified fixes or evidence-backed retirement proposals. Use when asked to dogfood, audit, rationalize, improve, simplify, or find value in an API; assess whether endpoints or features produce useful information; or decide what to keep, fix, combine, document, or retire.
Keep iterating on the next logical step in a project until a clear stop condition is reached. Use when the user says `/continue-loop`, asks to "keep going", "continue iterating", or wants Codex to repeatedly choose the highest-leverage next task, execute it, verify it, and then continue. Good for open-ended cleanup, refactoring, polish, debt burn-down, and project advancement where the next step should be discovered from the current repo state instead of handed over explicitly.
Find and explain churn hotspots and unstable code clusters in a git repo. Goes beyond a flat "most-edited files" list — auto-detects clusters by directory, by filename stem (foo.go + foo_test.go), and by co-change (files that change together) — then classifies each cluster (unstable / under-development / buggy / tightly-coupled / spec-shifting) and explains *why* it's a problem. Trigger whenever the user asks about churn, hotspots, unstable code, files that change a lot, refactoring candidates, technical debt hotspots, "what's a mess", "/hotmess", or any combination of folder + time window where they want insight rather than just numbers. Auto-detects code files when no extension is given.