dotnet-conventions

Enforce C# coding conventions for naming, async patterns, logging, and nullability.

2.5k|507|Updated Feb 7, 2014
One-click install
npx skills add https://github.com/exceptionless/Exceptionless --skill dotnet-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-conventions
Source: https://github.com/exceptionless/Exceptionless/tree/main/.agents/skills/dotnet-conventions
Command: npx skills add https://github.com/exceptionless/Exceptionless --skill dotnet-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that C# code adheres to established project conventions, improving code quality, maintainability, and consistency across the codebase.

Core Features & Use Cases

  • Naming Standards: Enforces consistent naming for fields, methods, variables, and types.
  • Async Patterns: Guides the correct implementation of asynchronous operations, including CancellationToken usage.
  • Structured Logging: Promotes the use of structured logging with message templates and scopes for better observability.
  • Nullability: Ensures proper handling of nullable reference types.
  • Formatting: Aligns code with project-specific style and formatting rules.
  • Use Case: When writing new C# classes or reviewing pull requests, use this Skill to automatically check for adherence to naming conventions, proper async patterns, and structured logging practices.

Quick Start

Apply the dotnet-conventions skill to ensure the C# code follows project standards for naming, async patterns, and logging.

Frequently Asked Questions about dotnet-conventions

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

FAQPage Schema
How do I enforce C# coding conventions for naming standards and async patterns?

To enforce C# coding conventions, apply checks during code authoring and pull request reviews for consistent naming, proper async patterns, and structured logging. This guarantees code consistency, maintainability, and adherence to established style guides.

What is the correct way to handle CancellationToken in .NET async patterns?

Correct .NET async patterns require proper implementation of asynchronous operations, including explicit CancellationToken usage. Following these conventions prevents unresponsive applications and ensures tasks are properly cancellable and resource-efficient.

How do I implement structured logging with message templates in C#?

Implement structured logging in C# by using message templates and scopes for better observability. This practice captures log properties as named values rather than interpolated strings, improving searchability and diagnostic analysis.

Does this coding style guide check nullable reference types in .NET?

Yes, this coding style guide ensures the proper handling of nullable reference types in .NET. It checks C# code authoring and review processes to enforce nullability conventions, preventing potential NullReferenceException issues.

Can I use this C# code style checker for pull request reviews?

Yes, you can use this C# code style checker during pull request reviews to automatically verify adherence to project standards. It validates formatting, naming conventions, async patterns, and structured logging practices.

Why does my .NET project need structured logging and nullability checks?

Your .NET project needs structured logging and nullability checks to improve code quality, maintainability, and consistency. These practices ensure better observability and prevent common runtime errors across the codebase.