dotnet-best-practices

dotnet-best-practices is a skill for Claude Code, Codex from OKHP3/skillz. It costs 21 tokens per session (610 once invoked), scanned A, a copy of dotnet-best-practices, MIT.

A checklist for reviewing C# and .NET code against conventions for documentation, architecture, dependency injection, design patterns, and resource management.

In plain words
What is it for?
Use it to review XML documentation, namespaces, service lifetimes, interfaces, factories, command handlers, and other .NET implementation choices.
Why use it?
It helps teams find inconsistencies and maintainable-code issues in a .NET solution before they become harder to correct.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review XML documentation, namespaces, service lifetimes, interfaces, factories, command handlers, and other .NET implementation choices.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/okhp3/skillz/dotnet-best-practices
View source ↗ OKHP3/skillz
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add OKHP3/skillz --skill dotnet-best-practices
Clone the repo
git clone --depth 1 https://github.com/OKHP3/skillz

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dotnet-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/okhp3/skillz/dotnet-best-practices/github.svg)](https://agentmods.dev/skills/okhp3/skillz/dotnet-best-practices)
Your own site
<a href="https://agentmods.dev/skills/okhp3/skillz/dotnet-best-practices"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/dotnet-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dotnet-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/okhp3/skillz/dotnet-best-practices"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/dotnet-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00610
Opus 5 $0.00010 $0.00305
Sonnet 5 $0.00004 $0.00122
Haiku 4.5 $0.00002 $0.00061

Measured 5d ago against content hash 3181f44dfc86, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

dotnet-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to dotnet-best-practices — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

community/dotnet-best-practices/SKILL.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.NET/C# Best Practices

Your task is to ensure .NET/C# code in ${selection} meets the best practices specific to this solution/project. This includes:

Documentation & Structure

  • Create comprehensive XML documentation comments for all public classes, interfaces, methods, and properties
  • Include parameter descriptions and return value descriptions in XML comments
  • Follow the established namespace structure: {Core|Console|App|Service}.{Feature}

Design Patterns & Architecture

  • Use primary constructor syntax for dependency injection (e.g., public class MyClass(IDependency dependency))
  • Implement the Command Handler pattern with generic base classes (e.g., CommandHandler<TOptions>)
  • Use interface segregation with clear naming conventions (prefix interfaces with 'I')
  • Follow the Factory pattern for complex object creation.

Dependency Injection & Services

  • Use constructor dependency injection with null checks via ArgumentNullException
  • Register services with appropriate lifetimes (Singleton, Scoped, Transient)
  • Use Microsoft.Extensions.DependencyInjection patterns
  • Implement service interfaces for testability

Resource Management & Localization

  • Use ResourceManager for localized messages and error strings
  • Separate LogMessages and ErrorMessages resource files
  • Access resources via _resourceManager.GetString("MessageKey")

Async/Await Patterns

  • Use async/await for all I/O operations and long-running tasks
  • Return Task or Task from async methods
  • Use ConfigureAwait(false) where appropriate
  • Handle async exceptions properly

Testing Standards

  • Use MSTest framework with FluentAssertions for assertions
  • Follow AAA pattern (Arrange, Act, Assert)
  • Use Moq for mocking dependencies
  • Test both success and failure scenarios
  • Include null parameter validation tests

Configuration & Settings

  • Use strongly-typed configuration classes with data annotations
  • Implement validation attributes (Required, NotEmptyOrWhitespace)
  • Use IConfiguration binding for settings
  • Support appsettings.json configuration files

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 86 lines · 21 tokens per session scan A 3181f44dfc86

Subscribe to this mod's changes

dotnet-best-practices is a skill published in the GitHub repository OKHP3/skillz (3 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 610 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to dotnet-best-practices, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

analyzing-dotnet-performance

Scans .NET code for 50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.

dotnet/skills · 64 tokens

de-sloppify

Systematic code cleanup pipeline for .NET projects. Runs 7 ordered steps: formatting, unused usings, analyzer warnings, dead code removal, TODO resolution, sealed class audit, and CancellationToken propagation. Each step is verified independently with tests between phases. Load this skill when: "clean up"…

codewithmukesh/dotnet-claude-kit · 115 tokens

121-java-object-oriented-design

Use when reviewing, improving, or refactoring Java object-oriented design, including applying SOLID, DRY, or YAGNI; improving classes and interfaces; correcting encapsulation, inheritance, or polymorphism; resolving God Class, Feature Envy, or Data Clumps; and improving object creation, methods, or exception…

jabrena/plinth · 107 tokens

053-design-simple-rules

Use when Java design, refactoring, or implementation tradeoffs should be evaluated with Kent Beck's simple design rules, including passes the tests, reveals intention, has no duplication, and has the fewest elements. This should trigger for requests such as Apply simple design rules; Review this design with Beck's…

jabrena/plinth · 86 tokens

eplan-development

Develop EPLAN Electric P8 scripts, API extensions, and remote-control applications. Use when writing C# scripts for EPLAN (actions, event handlers, ribbon), accessing the EPLAN API (parts database, projects, pages), building external apps that drive EPLAN via Remote Client, or debugging EPLAN automation issues…

covagashi/eplan-rag-mcp · 84 tokens

ontoly-software-graph

Use Ontoly's deterministic Software Graph and MCP capabilities for architecture review, request tracing, dependency analysis, configuration lookup, and impact analysis before falling back to source-file search.

anbeime/skill · 41 tokens