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.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download goldziher-ai-rulez-internal_builtins_languages_csharp_skills_csharp-conventions-ca967ad.zip · 0 KB
Part of goldziher/ai-rulez — 151 skills

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: .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.
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.

No comments yet.

Reviews (0)

No reviews yet.

Related