cratis-engineering-csharp-conventions

cratis-engineering-csharp-conventions is a skill for Claude Code, Codex from Cratis/AI. It costs 86 tokens per session (1,327 once invoked), scanned A, original, MIT.

A style guide for writing and reviewing C# in Cratis repositories. It covers naming, formatting, modern C# constructs, nullable values, documentation, exceptions, logging, dependency injection, and service lifetimes.

In plain words
What is it for?
It is for deciding how Cratis C# code should be structured, named, documented, logged, and reviewed.
Why use it?
It helps code match the project's conventions without confusing those conventions with rules enforced by the framework or a code checker.

Skill for Claude CodeCodex

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

Good fit It is for deciding how Cratis C# code should be structured, named, documented, logged, and reviewed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cratis/ai/cratis-engineering-csharp-conventions
View source ↗ Cratis/AI
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 Cratis/AI --skill cratis-engineering-csharp-conventions
Clone the repo
git clone --depth 1 https://github.com/Cratis/AI

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 cratis-engineering-csharp-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/cratis/ai/cratis-engineering-csharp-conventions.svg)](https://agentmods.dev/skills/cratis/ai/cratis-engineering-csharp-conventions)
Your own site
<a href="https://agentmods.dev/skills/cratis/ai/cratis-engineering-csharp-conventions"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-engineering-csharp-conventions.svg" alt="Measured on agentmods" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,327 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 original No closer match found 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.00086 $0.01327
Opus 5 $0.00043 $0.00664
Sonnet 5 $0.00017 $0.00265
Haiku 4.5 $0.00009 $0.00133

Measured today against content hash d61d0532162a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

cratis-engineering-csharp-conventions 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 today.

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.

engineering/skills/cratis-engineering-csharp-conventions/SKILL.md · 132 lines

How it starts

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

Cratis C# engineering conventions

These are the house conventions Cratis maintainers apply across every repository. They are conventions, not framework contracts: nothing here is enforced by an analyzer unless this skill says so. Follow them for consistency; do not claim the framework requires them.

Route near misses

  • The question is what a Cratis product API does: resolve it against the owning product repository, not against this style guide.
  • The subject is a specification file: the specification conventions own the Establish/Because/should_ pattern and the for_/when_ hierarchy.
  • The subject is TypeScript or React: this skill covers C# only.
  • The subject is repository structure or documentation: those are separate workflows.

Quick reference

  • Use current C# language features — records, primary constructors, pattern matching, collection expressions.
  • var over an explicit type; the right-hand side already names the type.
  • File-scoped namespace declarations.
  • using directives alphabetically sorted, single-line, unused ones removed.
  • No regions. A file that needs them needs refactoring instead.
  • No technical postfixes on type names: no Impl, Service, Manager, Handler, Base, Async.
  • No Exception suffix on exception types — AuthorNotFound, not AuthorNotFoundException.
  • Never throw a built-in exception type. Always define a domain exception.
  • record for events, commands, read models, concepts, and DTOs.
  • is null and is not null — never == null or != null.
  • Blank line before the opening { of every block.
  • A final return sits on its own line.
  • Private fields are _camelCase; interfaces take the I prefix.
  • American English everywhere — initialize, behavior, color, serialize.
  • Every file starts with the repository license header.

Formatting

// Copyright (c) Cratis. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace <RootNamespace>.<Feature>;

using <Namespace>.<First>;
using <Namespace>.<Second>;

// Blank line before the opening brace of every block
if (<condition>)
{
    <statement>;
}

// Expression-bodied form for simple members
public string <PropertyName> => $"{<First>} {<Second>}";

// The final return stands alone
public <ReturnType> <MethodName>()
{
    var result = <expression>;

    return result;
}

Read the full file on GitHub · 132 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today First seen · 132 lines · 86 tokens per session scan A d61d0532162a

Subscribe to this mod's changes

cratis-engineering-csharp-conventions is a skill published in the GitHub repository Cratis/AI (2 stars, last pushed today), licensed MIT. It adds 86 tokens to every session and 1,327 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-06.

Related

Other skills, from other repositories

resharper-clt

Use the free official JetBrains ReSharper Command Line Tools for .NET repositories. USE FOR: jb inspectcode; jb cleanupcode; stronger C# inspections, cleanup profiles, and CI-friendly JetBrains analysis. DO NOT USE FOR: replacing tests with inspection output; ad-hoc formatting-only work when the repo intentionally…

managedcode/dotnet-skills · 107 tokens

roslynator

Use the open-source free Roslynator analyzer packages and optional CLI for .NET. USE FOR: Roslynator.Analyzers setup; Roslynator CLI checks or cleanup; C# linting, static analysis, and code-fix automation. DO NOT USE FOR: overlapping analyzer packs with no consolidation plan; formatting-only work owned by another…

managedcode/dotnet-skills · 107 tokens

stylecop-analyzers

Use the open-source free StyleCop.Analyzers package for naming, layout, documentation, and style rules in .NET projects. Use when a repo wants stricter style conventions than the SDK analyzers alone provide. USE FOR: the repo wants StyleCop.Analyzers; naming, layout, or documentation style needs stronger enforcement…

managedcode/dotnet-skills · 142 tokens

dotnet-best-practices

Ensure .NET/C# code follows maintainable, modern best practices. Use when reviewing or improving C# code, solution structure, async patterns, dependency injection, or testability.

PracticalSwan/agent-skills · 43 tokens

dotnet-techne-cross-repo-impact

Use when reviewing a .NET pull request for breaking changes that may affect other microservice repositories. Detects cross-repo API, DTO, endpoint, EF entity, and NuGet-package breaks, and checks whether a compatible downstream PR already exists. Keywords: cross-repo impact, breaking change, microservice…

Metalnib/dotnet-episteme-skills · 95 tokens

dotnet-techne-synopsis

Use when you need blast-radius analysis, dependency graphs, cross-repo impact, breaking-change diff, or architectural overview of .NET workspaces. Keywords: blast radius, dependency graph, impact analysis, cross-repo, call graph, endpoint map, EF Core lineage, breaking change, daemon, reindex.

Metalnib/dotnet-episteme-skills · 70 tokens