Skip to content
Back to skills

Csharp Conventions

ASecurity

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.

  • 146 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 5, 2026
ai-agentsc#expresstestingsecurityperformance

Security analysis

A100/100

Scanned October 5, 2026

npx -y skills add Goldziher/ai-rulez --skill csharp-conventions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Csharp Conventions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Csharp Conventions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/goldziher-csharp-conventions/badge)](https://www.skillsdirectory.com/skills/goldziher-csharp-conventions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…