csharp-coding-standards

Define modern C# coding standards for .NET projects.

7|4|Updated Dec 12, 2023
One-click install
npx skills add https://github.com/BridgingIT-GmbH/bITdevKit --skill csharp-coding-standards-bridgingit-gmbh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-coding-standards
Source: https://github.com/BridgingIT-GmbH/bITdevKit/tree/main/.agents/skills/csharp-coding-standards
Command: npx skills add https://github.com/BridgingIT-GmbH/bITdevKit --skill csharp-coding-standards-bridgingit-gmbh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide provides a comprehensive set of C# coding standards to promote safety, performance, and consistency across projects, enabling teams to write cleaner, more maintainable code.

Core Features & Use Cases

  • Immutability and value semantics using records and readonly structs
  • Modern pattern matching, nullability, and async API design
  • Zero-allocation patterns with Span<T>/Memory<T> and careful API composition
  • Use of explicit mappings, Result types for errors, and avoidance of reflection

Quick Start

Adopt these guidelines in your codebase to start writing safer, faster C# with modern patterns today.

Frequently Asked Questions about csharp-coding-standards

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

FAQPage Schema
How do I enforce C# coding standards for records and value objects in domain modeling?

C# coding standards for domain modeling enforce immutability using records and readonly structs. This ensures value semantics and consistent, testable boundaries, guiding teams to write safer domain code.

What is the best way to handle expected errors in modern C# APIs?

The best way to handle expected errors in modern C# APIs is using the Result type. This enforces explicit, testable boundaries and avoids reflection-based mappings for safer, more maintainable code.

When do I need Span<T> and Memory<T> for zero-allocation patterns in C#?

You need Span<T> and Memory<T> for zero-allocation patterns in C# when writing performance-critical code. These standards guide careful API composition to minimize memory overhead across .NET projects.

Does this C# coding standards guide cover async API design and nullable references?

Yes, this C# coding standards guide covers async API design and nullable references. It specifies modern patterns for nullability and asynchronous operations to promote safe, overridable APIs.

Why should I avoid reflection-based mappings in C# domain modeling?

You should avoid reflection-based mappings in C# domain modeling because they break explicit, testable boundaries. The standards enforce explicit mappings instead, ensuring safer and more predictable code behavior.