C# Patterns

C# Patterns is a skill for Claude Code, Codex from AmariahAK/atlarix-skills. It costs 3 tokens per session (322 once invoked), scanned A, original, Apache-2.0.

A guide for C# projects built with .NET, a platform for creating applications and services. It covers asynchronous code, application layers, dependency injection, exceptions, and tests.

In plain words
What is it for?
Use it when structuring .NET applications, wiring dependencies, handling external calls, writing asynchronous code, or testing C# services.
Why use it?
It helps avoid blocked server threads, missing cancellation, tangled business logic, and unclear error handling.

Skill for Claude CodeCodex

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

Good fit Use it when structuring .NET applications, wiring dependencies, handling external calls, writing…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/amariahak/atlarix-skills/csharp
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 AmariahAK/atlarix-skills --skill csharp
Clone the repo
git clone --depth 1 https://github.com/AmariahAK/atlarix-skills

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 C# Patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/amariahak/atlarix-skills/csharp.svg)](https://agentmods.dev/skills/amariahak/atlarix-skills/csharp)
Your own site
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/csharp"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/csharp.svg" alt="Measured on agentmods" height="20"></a>
Per session 3 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 322 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.00003 $0.00322
Opus 5 $0.00002 $0.00161
Sonnet 5 $0.00001 $0.00064
Haiku 4.5 $0.00000 $0.00032

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

Security

Grade A, and why

C# Patterns 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 3d 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.

skills/csharp/SKILL.md · 52 lines

What it actually says

C# Patterns

When to use this skill

Use this skill when working in C# projects (.NET) and you want patterns for async correctness, clear layering, and safe dependency injection.

Core patterns

Async correctness

  • avoid .Result / .Wait()
  • propagate CancellationToken
  • set timeouts for external calls

Layering

  • controllers/handlers: request/response wiring only
  • services: business logic
  • repositories: persistence and queries

Exceptions

  • throw meaningful exceptions at boundaries
  • don’t catch and ignore
  • log with context (no secrets)

Testing

  • unit tests for pure logic
  • integration tests for DB/wiring

Atlarix tool notes

  • Explore: locate *.csproj and key entry points; inspect DI registrations.
  • Build: run dotnet test.
  • Debug: follow the first app frame in stack traces; check DI and config.
  • Review: check async/cancellation correctness and error handling.

Common mistakes to avoid

  • Blocking on async tasks
  • Missing cancellation tokens
  • Controllers that embed business logic

Mini-checklist

  • Async end-to-end
  • Layers separated
  • Tests cover critical behavior
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. 3d ago First seen · 52 lines · 3 tokens per session scan A c9651805e905

Subscribe to this mod's changes

C# Patterns is a skill published in the GitHub repository AmariahAK/atlarix-skills (2 stars, last pushed 6d ago), licensed Apache-2.0. It adds 3 tokens to every session and 322 once invoked, about $0.0000 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-03.

Related

Other skills, from other repositories

csharp-expert

Expert-level C# development with .NET 8+, ASP.NET Core, LINQ, async/await, and enterprise patterns. Use when the user mentions C#, .NET, ASP.NET, enterprise, or Microsoft platforms, or when the task involves Modern C#, Async/Await, LINQ, or ASP.NET Core.

personamanagmentlayer/pcl · 70 tokens

terse-sharp

Use when reading, searching, navigating, editing, refactoring, building or testing C#/.NET, XAML, .resx localization or Razor/Blazor in a solution served by the TerseSharp MCP server. Teaches which TerseSharp tool replaces which built-in, and how to drive all 88 of them, so a .cs file is never read whole, a symbol is…

amusleh-spotware-com/terse-sharp · 112 tokens

rider-search

Routing rules for code search in JetBrains Rider projects — use the Rider MCP symbol/reference/file tools instead of Bash grep. Use whenever searching for a symbol, definition, function, variable, type, or finding usages/references in a C#/.NET or Unreal C++ codebase open in Rider.

JSungMin/rider-mcp-enforcer · 60 tokens

generate-code-cs

Generate the code from typespec for C#. Parameter: C# SDK repository root location .

Azure/azure-sdk-for-net · 26 tokens

author-test

Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.

Azure/azure-sdk-for-net · 68 tokens

wpf

Build and modernize WPF applications on .NET with correct XAML, data binding, commands, threading, styling, and Windows desktop migration decisions. USE FOR: working on WPF UI, MVVM, binding, commands, or desktop modernization; migrating WPF from .NET Framework to .NET; integrating newer Windows capabilities into a…

managedcode/dotnet-skills · 122 tokens