csharp-conventions

Apply modern C# idioms to .NET projects with nullable reference types and records.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill csharp-conventions-aratkruglik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-conventions
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/csharp-foundation/skills/csharp-conventions
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill csharp-conventions-aratkruglik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern C# idioms exist to improve safety, readability, and maintainability across .NET projects, but teams often diverge on patterns and best practices.

Core Features & Use Cases

  • Enable nullable reference types globally in new and existing projects
  • Adopt records and readonly structs for immutable value types
  • Utilize pattern matching and concise var usage for clearer, safer code
  • Apply file-scoped namespaces to reduce indentation and boilerplate
  • Enforce proper disposal patterns with IDisposable / IAsyncDisposable and using statements
  • Standardize naming conventions and class design rules across libraries and apps

Quick Start

Enable Nullable in your project and adopt file-scoped namespaces for new code.

Frequently Asked Questions about csharp-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce nullable reference types across existing .NET projects?

Adopting records and readonly structs in C# provides immutable value types that ensure thread safety and prevent accidental data mutation. They are ideal for modeling domain data and DTOs across .NET libraries.

What is the proper disposal pattern for IDisposable and IAsyncDisposable in C#?

The proper disposal pattern in C# involves implementing IDisposable and IAsyncDisposable interfaces alongside using statements. This ensures deterministic cleanup of unmanaged resources and prevents memory leaks in .NET applications.

Does this C# conventions Skill work with .NET 6 and later versions?

Yes, these C# conventions target projects using C# 10 and .NET 6 or later. It applies modern idioms like file-scoped namespaces and pattern matching to ensure compatibility and readability across modern .NET project setups.

What's the best way to standardize naming conventions and class design rules in .NET?

File-scoped namespaces in C# reduce indentation and boilerplate by allowing namespace declarations on a single line. They improve code readability and are recommended for modern .NET project structures.