dotnet-orleans

Guidance for building and reviewing distributed .NET applications with Microsoft Orleans. Orleans models many independent, stateful entities as grains that run inside silos.

In plain words
What is it for?
Use it for applications involving entities such as users, carts, devices, rooms, orders, sessions, or collaborative documents, including deployments with Redis, Azure, Kubernetes, or .NET Aspire.
Why use it?
It helps you decide whether Orleans fits the system and choose suitable approaches for state, messaging, scheduling, storage, deployment, and testing.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/managedcode/dotpilot/dotnet-orleans
Any agent
npx skills add managedcode/dotPilot --skill dotnet-orleans
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotPilot

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,724 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00034 $0.01724
Opus 5 $0.00017 $0.00862
Sonnet 5 $0.00007 $0.00345
Haiku 4.5 $0.00003 $0.00172

Measured yesterday against content hash 445a337f2349, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dotnet-orleans 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 yesterday.

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.

.codex/skills/dotnet-orleans/SKILL.md · 109 lines

How it starts

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

Microsoft Orleans

Trigger On

  • building or reviewing .NET code that uses Microsoft.Orleans.*, Grain, IGrainWith*, UseOrleans, UseOrleansClient, IGrainFactory, or Orleans silo/client builders
  • modeling high-cardinality stateful entities such as users, carts, devices, rooms, orders, digital twins, sessions, or collaborative documents
  • choosing between grains, streams, reminders, stateless workers, persistence providers, placement strategies, and external client/frontend topologies
  • deploying or operating Orleans with Redis, Azure Storage, Cosmos DB, ADO.NET, .NET Aspire, Kubernetes, Azure Container Apps, or built-in/dashboard observability

Workflow

  1. Decide whether Orleans is the right abstraction. Use it when the system has many loosely coupled interactive entities which can each stay small and single-threaded. Do not force Orleans onto shared-memory workloads, long batch jobs, or systems dominated by constant global coordination.
  2. Model grain boundaries around business identity, not around controllers, tables, or arbitrary CRUD slices. Prefer one grain per user, cart, device, room, order, or other durable entity.
  3. Keep grain APIs coarse-grained and fully asynchronous. Avoid .Result, .Wait(), blocking I/O, lock-based coordination, or long chatty call chains between grains.
  4. Use current Orleans state patterns. Prefer constructor-injected IPersistentState<TState> with named states and named providers. Treat Grain<TState> as legacy unless you are constrained by existing code.
  5. Pick the right runtime primitive deliberately:
    • use standard grains for stateful request/response logic
    • use [StatelessWorker] for pure stateless fan-out or compute helpers
    • use Orleans streams for decoupled event flow and pub/sub
    • use RegisterGrainTimer for activation-local periodic work
    • use reminders for durable low-frequency wakeups which must survive deactivation or restarts
  6. Choose hosting intentionally. Use UseOrleans for silos and UseOrleansClient for separate clients. In Aspire, declare the Orleans resource in AppHost, wire clustering/storage/reminders there, and use .AsClient() for frontend-only consumers.
  7. Configure providers with production realism. In-memory storage, reminders, and stream providers are for development or tests only. Prefer managed identity and DefaultAzureCredential for Azure-backed providers when possible.
  8. Treat placement and activation movement as optimization tools, not defaults to cargo-cult. Start with the current runtime defaults and only add custom placement, rebalancing, or repartitioning when measurement shows a real locality or load problem.
  9. Make the cluster observable. Add logging, OpenTelemetry, health checks, and dashboard access deliberately. If you expose the Orleans Dashboard, secure it with ASP.NET Core authorization and treat it as an operational surface.
  10. Test the cluster behavior you actually depend on. Prefer InProcessTestCluster for new tests, add multi-silo coverage when placement, reminders, persistence, or failover behavior matters, and benchmark hot grains before claiming the design scales.

Read the full file on GitHub · 109 lines

Files

What ships with it

8 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. yesterday First seen · 109 lines · 34 tokens per session scan A 445a337f2349

Subscribe to this mod's changes

dotnet-orleans is a skill published in the GitHub repository managedcode/dotPilot (23 stars, last pushed 4mo ago), licensed MIT. It adds 34 tokens to every session and 1,724 once invoked, about $0.0002 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-08-30.