csharp-concurrency-patterns

csharp-concurrency-patterns is a skill for Claude Code from Aaronontheweb/dotnet-skills. It costs 48 tokens per session (2,013 once invoked), scanned A, original, MIT.

Guidance for choosing how .NET programs handle several operations at the same time, including async/await, Channels, and Akka.NET.

In plain words
What is it for?
Use it for input/output tasks, producer-and-consumer data flows, streams needing backpressure or batching, and state shared across concurrent entities.
Why use it?
It helps avoid unnecessary locks and shared-state bugs by matching the solution to the kind of concurrent work being done.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the dotnet-skills plugin — 40 skills, 6 agents shipped together

Good fit Use it for input/output tasks, producer-and-consumer data flows, streams needing backpressure or batching, and state shared across concurrent entities.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns
About the project

.NET Skills is an AI coding plugin that provides skills and specialized guidance for professional .NET development, covering areas such as C#, Akka.NET, Aspire, Entity Framework Core, testing, and performance. .NET developers use it with coding assistants to apply production-oriented patterns while building and maintaining applications. The catalogue contains the plugin’s skills, agents, and instructions.

Aaronontheweb/dotnet-skills · 1,284 stars · on GitHub

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 Aaronontheweb/dotnet-skills --skill csharp-concurrency-patterns
Clone the repo
git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills

Made for: Claude Code.

Or install dotnet-skills, the plugin that ships this one along with the rest of its 40 skills, 6 agents.

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 csharp-concurrency-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns/github.svg)](https://agentmods.dev/skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns)
Your own site
<a href="https://agentmods.dev/skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns"><img src="https://agentmods.dev/badge/skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns/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 csharp-concurrency-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns"><img src="https://agentmods.dev/badge/skills/aaronontheweb/dotnet-skills/csharp-concurrency-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,013 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. Third-party audits
  • Socket pass 10 Oct 2026
  • Snyk pass 10 Oct 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00048 $0.02013
Opus 5.5 $0.00019 $0.00805
Sonnet 5.5 $0.00010 $0.00403
Haiku 4.5 $0.00005 $0.00201

Measured 1mo ago against content hash 9d9d6057c2f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

csharp-concurrency-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 1mo 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

Copies of this mod

2 near-identical copies found in the catalogue:

skills/csharp-concurrency-patterns/SKILL.md · 274 lines

How it starts

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

.NET Concurrency: Choosing the Right Tool

When to Use This Skill

Use this skill when:

  • Deciding how to handle concurrent operations in .NET
  • Evaluating whether to use async/await, Channels, Akka.NET, or other abstractions
  • Tempted to use locks, semaphores, or other synchronization primitives
  • Need to process streams of data with backpressure, batching, or debouncing
  • Managing state across multiple concurrent entities

Reference Files

  • advanced-concurrency.md: Akka.NET Streams, Reactive Extensions, Akka.NET Actors (entity-per-actor, state machines, cluster sharding), and async local function patterns

The Philosophy

Start simple, escalate only when needed.

Most concurrency problems can be solved with async/await. Only reach for more sophisticated tools when you have a specific need that async/await can't address cleanly.

Try to avoid shared mutable state. The best way to handle concurrency is to design it away. Immutable data, message passing, and isolated state (like actors) eliminate entire categories of bugs.

Locks should be the exception, not the rule. When you can't avoid shared mutable state:

  1. First choice: Redesign to avoid it (immutability, message passing, actor isolation)
  2. Second choice: Use System.Collections.Concurrent (ConcurrentDictionary, etc.)
  3. Third choice: Use Channel<T> to serialize access through message passing
  4. Last resort: Use lock for simple, short-lived critical sections

Decision Tree

What are you trying to do?
│
├─► Wait for I/O (HTTP, database, file)?
│   └─► Use async/await
│
├─► Process a collection in parallel (CPU-bound)?
│   └─► Use Parallel.ForEachAsync
│
├─► Producer/consumer pattern (work queue)?
│   └─► Use System.Threading.Channels
│
├─► UI event handling (debounce, throttle, combine)?
│   └─► Use Reactive Extensions (Rx)
│
├─► Server-side stream processing (backpressure, batching)?
│   └─► Use Akka.NET Streams
│
├─► State machines with complex transitions?
│   └─► Use Akka.NET Actors (Become pattern)
│
├─► Manage state for many independent entities?
│   └─► Use Akka.NET Actors (entity-per-actor)
│
├─► Coordinate multiple async operations?
│   └─► Use Task.WhenAll / Task.WhenAny
│
└─► None of the above fits?
    └─► Ask yourself: "Do I really need shared mutable state?"
        ├─► Yes → Consider redesigning to avoid it
        └─► Truly unavoidable → Use Channels or Actors to serialize access

Read the full file on GitHub · 274 lines

Files

What ships with it

1 file 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. 1mo ago Changed 9d9d6057c2f7
  2. 3mo ago First seen · 274 lines · 48 tokens per session scan A c0925de5860f

Subscribe to this mod's changes

csharp-concurrency-patterns is a skill published in the GitHub repository Aaronontheweb/dotnet-skills (1,284 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 2,013 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

csharp-concurrency-patterns compared with skills from other repositories

csharp-concurrency-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
csharp-concurrency-patternsAaronontheweb/dotnet-skillsSkill1.3k2d agoMITA48Claude Code
agui-dotnet-streaming-chatag-ui-protocol/ag-uiSkill23ktodayMITA223Claude Code
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.5ktodayMITA149Claude Code
migrate-dotnet8-to-dotnet9dotnet/skillsSkill6.5ktodayMITA176Claude Code
azure-mgmt-apicenter-dotnetmicrosoft/skillsSkill3.3k2d agoMITA97Claude Code
template-instantiationdotnet/skillsSkill6.5ktodayMITA168Claude Code
template-validationdotnet/skillsSkill6.5ktodayMITA131Claude Code