Claude
Cursor
Skill
csharp-conventions
C# code conventions covering .NET 8+/C# 12, nullable reference types, Roslyn analyzers, xUnit, record types, async/await discipline, and dependency security. Load when writing or reviewing C# code.
Virus-scanned
Reviewed automatically before listing.
Download
goldziher-ai-rulez-internal_builtins_languages_csharp_skills_csharp-conventions-ca967ad.zip · 0 KB
Install
skills CLI
npx skills add https://github.com/Goldziher/ai-rulez/tree/main/internal/builtins/languages/csharp/skills/csharp-conventions
Claude Code
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
Git
git clone https://github.com/Goldziher/ai-rulez.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
- .NET 8+ C# 12, file-scoped namespaces, primary constructors,
<Nullable>enable</Nullable>. - Formatting:
dotnet format+ Roslyn analyzers,<TreatWarningsAsErrors>true</TreatWarningsAsErrors>. - Style enforcement:
.editorconfigfor consistent rules across team. Use an analyzer set (e.g., StyleCop.Analyzers or Roslynator). - Testing: xUnit with
[Theory]/[InlineData], an assertion library (e.g., FluentAssertions), a coverage tool (e.g., coverlet) at 80%+. - Benchmarking: a benchmark harness (e.g., BenchmarkDotNet) for performance testing — never
Stopwatchloops. recordtypes for immutable data,requiredproperties, pattern matching in switch expressions.- Async:
async/awaitthroughout — never.Resultor.Wait(),ValueTaskfor hot paths, avoid deadlocks. - Security:
dotnet list package --vulnerablefor CVE scanning. Zero tolerance for critical/high. - Dependencies: NuGet
PackageReference, commitpackages.lock.json,Directory.Build.propsfor shared config. - Collection expressions (
[1, 2, 3]),requiredmodifier, raw string literals for multi-line. - Anti-patterns:
dynamic,objectparams, unguardedcatch (Exception),#pragma warning disable.
Files (ai-rulez)
-
SKILL.md 1.4 KB
--- name: csharp-conventions description: C# code conventions covering .NET 8+/C# 12, nullable reference types, Roslyn analyzers, xUnit, record types, async/await discipline, and dependency security. Load when writing or reviewing C# code. --- - .NET 8+ C# 12, file-scoped namespaces, primary constructors, `<Nullable>enable</Nullable>`. - Formatting: `dotnet format` + Roslyn analyzers, `<TreatWarningsAsErrors>true</TreatWarningsAsErrors>`. - Style enforcement: `.editorconfig` for consistent rules across team. Use an analyzer set (e.g., StyleCop.Analyzers or Roslynator). - Testing: xUnit with `[Theory]`/`[InlineData]`, an assertion library (e.g., FluentAssertions), a coverage tool (e.g., coverlet) at 80%+. - Benchmarking: a benchmark harness (e.g., BenchmarkDotNet) for performance testing — never `Stopwatch` loops. - `record` types for immutable data, `required` properties, pattern matching in switch expressions. - Async: `async`/`await` throughout — never `.Result` or `.Wait()`, `ValueTask` for hot paths, avoid deadlocks. - Security: `dotnet list package --vulnerable` for CVE scanning. Zero tolerance for critical/high. - Dependencies: NuGet `PackageReference`, commit `packages.lock.json`, `Directory.Build.props` for shared config. - Collection expressions (`[1, 2, 3]`), `required` modifier, raw string literals for multi-line. - Anti-patterns: `dynamic`, `object` params, unguarded `catch (Exception)`, `#pragma warning disable`.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.