GitVersion .NET Development
GitTools/GitVersion
Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.
Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-hosting-actor-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/akka-hosting-actor-patterns .claude/skills/akka-hosting-actor-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "akka-hosting-actor-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns into .claude/skills/akka-hosting-actor-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-hosting-actor-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-hosting-actor-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/akka-hosting-actor-patterns .agents/skills/akka-hosting-actor-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "akka-hosting-actor-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns into .agents/skills/akka-hosting-actor-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-hosting-actor-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-hosting-actor-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/akka-hosting-actor-patterns .cursor/skills/akka-hosting-actor-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "akka-hosting-actor-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns into .cursor/skills/akka-hosting-actor-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-hosting-actor-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Aaronontheweb/dotnet-skills.git --path skills/akka-hosting-actor-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-hosting-actor-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/akka-hosting-actor-patterns .gemini/skills/akka-hosting-actor-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "akka-hosting-actor-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns into .gemini/skills/akka-hosting-actor-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-hosting-actor-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Aaronontheweb/dotnet-skills akka-hosting-actor-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/akka-hosting-actor-patterns .github/skills/akka-hosting-actor-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "akka-hosting-actor-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns into .github/skills/akka-hosting-actor-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-hosting-actor-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-hosting-actor-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/akka-hosting-actor-patterns .opencode/skills/akka-hosting-actor-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "akka-hosting-actor-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns into .opencode/skills/akka-hosting-actor-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-hosting-actor-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
akka-hosting-actor-patternsShows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.
The skill is a set of C# patterns for actors that stand in for domain objects such as users, orders and invoices. An execution-mode enum decides whether the actor system runs locally or as a cluster, so tests can skip clustering while production uses cluster sharding with the same actor code. A GenericChildPerEntityParent routes messages to child entities and copies sharding behavior without needing a cluster.
Message routing reuses the IMessageExtractor interface from Akka.Cluster.Sharding, and extension methods on the Akka.Hosting builder hide the mode choice behind one registration call, with a helper that registers every domain actor together. For time-based logic it registers the actor system's Scheduler as an ITimeProvider instead of calling DateTime.Now. Durable scheduled work that survives restarts is handled with akka-reminders and SQL persistence, including a custom reminder resolver for the child-per-entity layout.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit e426ed9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Akka.Hosting Actor Patterns loads about 5k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 704 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Aaronontheweb/dotnet-skills at commit e426ed9, republished under its MIT licence (© Aaronontheweb). 704 words, ~4,989 tokens.
.claude/skills/akka-hosting-actor-patterns/SKILL.md (or your agent's skills folder).Use this skill when:
Define an enum to control actor behavior:
/// <summary>
/// Determines how Akka.NET should be configured
/// </summary>
public enum AkkaExecutionMode
{
/// <summary>
/// Pure local actor system - no remoting, no clustering.
/// Use GenericChildPerEntityParent instead of ShardRegion.
/// Ideal for unit tests and simple scenarios.
/// </summary>
LocalTest,
/// <summary>
/// Full clustering with ShardRegion.
/// Use for integration testing and production.
/// </summary>
Clustered
}A lightweight parent actor that routes messages to child entities, mimicking cluster sharding semantics without requiring a cluster:
using Akka.Actor;
using Akka.Cluster.Sharding;
/// <summary>
/// A generic "child per entity" parent actor.
/// </summary>
/// <remarks>
/// Reuses Akka.Cluster.Sharding's IMessageExtractor for consistent routing.
/// Ideal for unit tests where clustering overhead is unnecessary.
/// </remarks>
public sealed class GenericChildPerEntityParent : ReceiveActor
{
public static Props CreateProps(
IMessageExtractor extractor,
Func<string, Props> propsFactory)
{
return Props.Create(() =>
new GenericChildPerEntityParent(extractor, propsFactory));
}
private readonly IMessageExtractor _extractor;
private readonly Func<string, Props> _propsFactory;
public GenericChildPerEntityParent(
IMessageExtractor extractor,
Func<string, Props> propsFactory)
{
_extractor = extractor;
_propsFactory = propsFactory;
ReceiveAny(message =>
{
var entityId = _extractor.EntityId(message);
if (entityId is null) return;
// Get existing child or create new one
Context.Child(entityId)
.GetOrElse(() => Context.ActorOf(_propsFactory(entityId), entityId))
.Forward(_extractor.EntityMessage(message));
});
}
}Create extractors that implement IMessageExtractor from Akka.Cluster.Sharding:
using Akka.Cluster.Sharding;
/// <summary>
/// Routes messages to entity actors based on a strongly-typed ID.
/// </summary>
public sealed class OrderMessageExtractor : HashCodeMessageExtractor
{
public const int DefaultShardCount = 40;
public OrderMessageExtractor(int maxNumberOfShards = DefaultShardCount)
: base(maxNumberOfShards)
{
}
public override string? EntityId(object message)
{
return message switch
{
IWithOrderId msg => msg.OrderId.Value.ToString(),
_ => null
};
}
}
// Define an interface for messages that target a specific entity
public interface IWithOrderId
{
OrderId OrderId { get; }
}
// Use strongly-typed IDs
public readonly record struct OrderId(Guid Value)
{
public static OrderId New() => new(Guid.NewGuid());
public override string ToString() => Value.ToString();
}Create extension methods that abstract the execution mode:
using Akka.Cluster.Hosting;
using Akka.Cluster.Sharding;
using Akka.Hosting;
public static class OrderActorHostingExtensions
{
/// <summary>
/// Adds OrderActor with support for both local and clustered modes.
/// </summary>
public static AkkaConfigurationBuilder WithOrderActor(
this AkkaConfigurationBuilder builder,
AkkaExecutionMode executionMode = AkkaExecutionMode.Clustered,
string? clusterRole = null)
{
if (executionMode == AkkaExecutionMode.LocalTest)
{
// Non-clustered mode: Use GenericChildPerEntityParent
builder.WithActors((system, registry, resolver) =>
{
var parent = system.ActorOf(
GenericChildPerEntityParent.CreateProps(
new OrderMessageExtractor(),
entityId => resolver.Props<OrderActor>(entityId)),
"orders");
registry.Register<OrderActor>(parent);
});
}
else
{
// Clustered mode: Use ShardRegion
builder.WithShardRegion<OrderActor>(
"orders",
(system, registry, resolver) =>
entityId => resolver.Props<OrderActor>(entityId),
new OrderMessageExtractor(),
new ShardOptions
{
StateStoreMode = StateStoreMode.DData,
Role = clusterRole
});
}
return builder;
}
}Create a convenience method that registers all domain actors:
public static class DomainActorHostingExtensions
{
/// <summary>
/// Adds all order domain actors with sharding support.
/// </summary>
public static AkkaConfigurationBuilder WithOrderDomainActors(
this AkkaConfigurationBuilder builder,
AkkaExecutionMode executionMode = AkkaExecutionMode.Clustered,
string? clusterRole = null)
{
return builder
.WithOrderActor(executionMode, clusterRole)
.WithPaymentActor(executionMode, clusterRole)
.WithShipmentActor(executionMode, clusterRole)
.WithNotificationActor(); // Singleton, no sharding needed
}
}Register the ActorSystem's Scheduler as an ITimeProvider for testable time-based logic:
public static class SharedAkkaHostingExtensions
{
public static IServiceCollection AddAkkaWithTimeProvider(
this IServiceCollection services,
Action<AkkaConfigurationBuilder, IServiceProvider> configure)
{
// Register ITimeProvider using the ActorSystem's Scheduler
services.AddSingleton<ITimeProvider>(sp =>
sp.GetRequiredService<ActorSystem>().Scheduler);
return services.ConfigureAkka((builder, sp) =>
{
configure(builder, sp);
});
}
}
// In your actor, inject ITimeProvider
public class SubscriptionActor : ReceiveActor
{
private readonly ITimeProvider _timeProvider;
public SubscriptionActor(ITimeProvider timeProvider)
{
_timeProvider = timeProvider;
// Use _timeProvider.GetUtcNow() instead of DateTime.UtcNow
// This allows tests to control time
}
}For durable scheduled tasks that survive restarts, use akka-reminders:
using Akka.Reminders;
using Akka.Reminders.Sql;
using Akka.Reminders.Sql.Configuration;
using Akka.Reminders.Storage;
public static class ReminderHostingExtensions
{
/// <summary>
/// Configures akka-reminders with PostgreSQL storage.
/// </summary>
public static AkkaConfigurationBuilder WithPostgresReminders(
this AkkaConfigurationBuilder builder,
string connectionString,
string schemaName = "reminders",
string tableName = "scheduled_reminders",
bool autoInitialize = true)
{
return builder.WithLocalReminders(reminders => reminders
.WithResolver(sys => new GenericChildPerEntityResolver(sys))
.WithStorage(system =>
{
var settings = SqlReminderStorageSettings.CreatePostgreSql(
connectionString,
schemaName,
tableName,
autoInitialize);
return new SqlReminderStorage(settings, system);
})
.WithSettings(new ReminderSettings
{
MaxSlippage = TimeSpan.FromSeconds(30),
MaxDeliveryAttempts = 3,
RetryBackoffBase = TimeSpan.FromSeconds(10)
}));
}
/// <summary>
/// Configures akka-reminders with in-memory storage for testing.
/// </summary>
public static AkkaConfigurationBuilder WithInMemoryReminders(
this AkkaConfigurationBuilder builder)
{
return builder.WithLocalReminders(reminders => reminders
.WithResolver(sys => new GenericChildPerEntityResolver(sys))
.WithStorage(system => new InMemoryReminderStorage())
.WithSettings(new ReminderSettings
{
MaxSlippage = TimeSpan.FromSeconds(1),
MaxDeliveryAttempts = 3,
RetryBackoffBase = TimeSpan.FromMilliseconds(100)
}));
}
}Route reminder callbacks to GenericChildPerEntityParent actors:
using Akka.Actor;
using Akka.Hosting;
using Akka.Reminders;
/// <summary>
/// Resolves reminder targets to GenericChildPerEntityParent actors.
/// </summary>
public sealed class GenericChildPerEntityResolver : IReminderActorResolver
{
private readonly ActorSystem _system;
public GenericChildPerEntityResolver(ActorSystem system)
{
_system = system;
}
public IActorRef ResolveActorRef(ReminderEntry entry)
{
var registry = ActorRegistry.For(_system);
return entry.Key switch
{
var k when k.StartsWith("order-") =>
registry.Get<OrderActor>(),
var k when k.StartsWith("subscription-") =>
registry.Get<SubscriptionActor>(),
_ => throw new InvalidOperationException(
$"Unknown reminder key format: {entry.Key}")
};
}
}For actors that should only have one instance:
public static AkkaConfigurationBuilder WithEmailSenderActor(
this AkkaConfigurationBuilder builder)
{
return builder.WithActors((system, registry, resolver) =>
{
var actor = system.ActorOf(
resolver.Props<EmailSenderActor>(),
"email-sender");
registry.Register<EmailSenderActor>(actor);
});
}When you need to reference actors that are registered as parents:
/// <summary>
/// Marker type for ActorRegistry to retrieve the order manager
/// (GenericChildPerEntityParent for OrderActors).
/// </summary>
public sealed class OrderManagerActor;
// Usage in extension method
registry.Register<OrderManagerActor>(parent);
// Usage in controller/service
public class OrderService
{
private readonly IActorRef _orderManager;
public OrderService(IRequiredActor<OrderManagerActor> orderManager)
{
_orderManager = orderManager.ActorRef;
}
public async Task<OrderResponse> CreateOrder(CreateOrderCommand cmd)
{
return await _orderManager.Ask<OrderResponse>(cmd);
}
}Actors don't have automatic DI scopes. Unlike ASP.NET controllers (where each HTTP request creates a scope), actors are long-lived. If you need scoped services (like DbContext), inject IServiceProvider and create scopes manually.
public sealed class OrderProcessingActor : ReceiveActor
{
private readonly IServiceProvider _serviceProvider;
private readonly IActorRef _notificationActor;
public OrderProcessingActor(
IServiceProvider serviceProvider,
IRequiredActor<NotificationActor> notificationActor)
{
_serviceProvider = serviceProvider;
_notificationActor = notificationActor.ActorRef;
ReceiveAsync<ProcessOrder>(HandleProcessOrder);
}
private async Task HandleProcessOrder(ProcessOrder msg)
{
// Create scope for this message - disposed after processing
using var scope = _serviceProvider.CreateScope();
// Resolve scoped services within the scope
var orderRepository = scope.ServiceProvider.GetRequiredService<IOrderRepository>();
var paymentService = scope.ServiceProvider.GetRequiredService<IPaymentService>();
var emailComposer = scope.ServiceProvider.GetRequiredService<IOrderEmailComposer>();
// Do work with scoped services
var order = await orderRepository.GetByIdAsync(msg.OrderId);
var payment = await paymentService.ProcessAsync(order);
// DbContext changes committed when scope disposes
}
}| Benefit | Explanation |
|---|---|
| Fresh DbContext per message | No stale entity tracking between messages |
| Proper disposal | Database connections released after each message |
| Isolation | One message's errors don't corrupt another's state |
| Testable | Can inject mock IServiceProvider in tests |
For stateless, thread-safe services, inject directly (no scope needed):
public sealed class NotificationActor : ReceiveActor
{
private readonly IEmailLinkGenerator _linkGenerator; // Singleton - OK!
private readonly IMjmlTemplateRenderer _renderer; // Singleton - OK!
public NotificationActor(
IEmailLinkGenerator linkGenerator,
IMjmlTemplateRenderer renderer)
{
_linkGenerator = linkGenerator;
_renderer = renderer;
Receive<SendWelcomeEmail>(Handle);
}
}// BAD: Scoped service injected into long-lived actor
public sealed class BadActor : ReceiveActor
{
private readonly IOrderRepository _repo; // Scoped! DbContext lives forever!
public BadActor(IOrderRepository repo) // Captured at actor creation
{
_repo = repo; // This DbContext will become stale
}
}
// GOOD: Inject IServiceProvider, create scope per message
public sealed class GoodActor : ReceiveActor
{
private readonly IServiceProvider _sp;
public GoodActor(IServiceProvider sp)
{
_sp = sp;
ReceiveAsync<ProcessOrder>(async msg =>
{
using var scope = _sp.CreateScope();
var repo = scope.ServiceProvider.GetRequiredService<IOrderRepository>();
// Fresh DbContext for this message
});
}
}For more on DI lifetimes and scope management, see microsoft-extensions/dependency-injection skill.
RememberEntities controls whether the shard region remembers and automatically restarts all entities that were ever created. This should almost always be false.
builder.WithShardRegion<OrderActor>(
"orders",
(system, registry, resolver) => entityId => resolver.Props<OrderActor>(entityId),
new OrderMessageExtractor(),
new ShardOptions
{
StateStoreMode = StateStoreMode.DData,
RememberEntities = false, // DEFAULT - almost always correct
Role = clusterRole
});When RememberEntities = true causes problems:
| Problem | Explanation |
|---|---|
| Unbounded memory growth | Every entity ever created gets remembered and restarted forever |
| Slow cluster startup | Cluster must restart thousands/millions of entities on boot |
| Stale entity resurrection | Expired sessions, sent emails, old orders all get restarted |
| No passivation | Idle entities consume memory indefinitely (passivation is disabled) |
| Entity Type | RememberEntities | Reason |
|---|---|---|
UserSessionActor | false | Sessions expire, created on login |
DraftActor | false | Drafts are sent/discarded, ephemeral |
EmailSenderActor | false | Fire-and-forget operations |
OrderActor | false | Orders complete, new ones created constantly |
ShoppingCartActor | false | Carts expire, abandoned carts common |
TenantActor | maybe true | Fixed set of tenants, always needed |
AccountActor | maybe true | Bounded set of accounts, long-lived |
Rule of thumb: Use RememberEntities = true only for:
<T>When using WithShardRegion<T>, the generic parameter T serves as a marker type for the ActorRegistry. Use a dedicated marker type (not the actor class itself) for consistent registry access:
/// <summary>
/// Marker type for ActorRegistry. Use this to retrieve the OrderActor shard region.
/// </summary>
public sealed class OrderActorRegion;
// Registration - use marker type as generic parameter
builder.WithShardRegion<OrderActorRegion>(
"orders",
(system, registry, resolver) => entityId => resolver.Props<OrderActor>(entityId),
new OrderMessageExtractor(),
new ShardOptions { StateStoreMode = StateStoreMode.DData });
// Retrieval - same marker type
var orderRegion = ActorRegistry.Get<OrderActorRegion>();
orderRegion.Tell(new CreateOrder(orderId, amount));Why marker types?
WithShardRegion<T> auto-registers the shard region under type TWithShardRegion<T> automatically registers the shard region in the ActorRegistry. Don't call registry.Register<T>() again:
// BAD - redundant registration
builder.WithShardRegion<OrderActorRegion>("orders", ...)
.WithActors((system, registry, resolver) =>
{
var region = registry.Get<OrderActorRegion>();
registry.Register<OrderActorRegion>(region); // UNNECESSARY!
});
// GOOD - WithShardRegion already registers
builder.WithShardRegion<OrderActorRegion>("orders", ...);
// That's it - OrderActorRegion is now in the registryOrderId instead of string or GuidIWithOrderId for type-safe extractionDateTime.Now directly in actors© Aaronontheweb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/akka-hosting-actor-patterns of Aaronontheweb/dotnet-skills.
Open the folder on GitHubat commit e426ed9
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Aaronontheweb/dotnet-skills, which our catalogue first saw on October 7, 2026.
Akka.Hosting Actor Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Akka.Hosting Actor Patterns this skillAaronontheweb/dotnet-skills | 1.2k | 1 repos | ~5k | Automated safety check: Pass | MIT | |
| GitVersion .NET DevelopmentGitTools/GitVersion | 3.1k | — | ~1.7k | Automated safety check: Pass | MIT | |
| Dotnet Patternsaffaan-m/ECC | 275k | 1 repos | ~2.3k | Automated safety check: Pass | MIT | |
| Dotnet Best Practicesgithub/awesome-copilot | 40k | 3 repos | ~808 | Automated safety check: Pass | MIT | |
| Dotnet Design Pattern Reviewgithub/awesome-copilot | 40k | 3 repos | ~821 | Automated safety check: Pass | MIT | |
| Architecturemanagedcode/dotnet-skills | 486 | — | ~659 | Automated safety check: Pass | MIT |
GitTools/GitVersion
Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.
affaan-m/ECC
Idiomatic C and .NET patterns, conventions, dependency injection, async/await, and best practices for building robust, maintainable .NET applications.
github/awesome-copilot
Ensure .NET/C code meets best practices for the solution/project.
github/awesome-copilot
Review the C/.NET code for design pattern implementation and suggest improvements.
managedcode/dotnet-skills
Design or review .NET solution architecture across modular monoliths, clean architecture, vertical slices, microservices, DDD, CQRS, and cloud-native boundaries without over-engineering.
wshobson/agents
Master C/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications.
Aaronontheweb/dotnet-skills
Applies extend-only design rules to NuGet packages and distributed systems, covering source, binary and wire compatibility and how to deprecate members safely.
Aaronontheweb/dotnet-skills
Guides making .NET libraries trimming-safe and Native-AOT compatible: the MSBuild properties, trimming attributes, warning codes and a playbook of safe patterns.
Aaronontheweb/dotnet-skills
Guidance for Akka.NET actor systems covering EventStream versus DistributedPubSub, supervision, Props versus DependencyResolver, work distribution and testable cluster code.
Aaronontheweb/dotnet-skills
Sets up Akka.Management and Cluster.Bootstrap so Akka.NET clusters form through service discovery on Kubernetes, Azure or config instead of static seed nodes.
Aaronontheweb/dotnet-skills
Shows how to test Akka.NET actors with Akka.Hosting.TestKit: swapping services for fakes, using TestProbes, and checking persistence, plus when the older TestKit still fits.
Aaronontheweb/dotnet-skills
Wires .NET Aspire AppHost resources into explicit environment-variable configuration, keeping application code free of Aspire client packages and service discovery.
Categories
Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production. The skill is a set of C# patterns for actors that stand in for domain objects such as users, orders and invoices. An execution-mode enum decides whether the actor system runs locally or as a cluster, so tests can skip clustering while production uses cluster sharding with the same actor code.
Akka.Hosting Actor Patterns fits situations like: building entity actors for users, orders or invoices with Akka.NET; making actors testable locally and sharded in a production cluster; scheduling durable, restart-safe tasks with akka-reminders; registering actors through Akka.Hosting extension methods.
Run `npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a claude-code`. Or copy the skill folder (skills/akka-hosting-actor-patterns in Aaronontheweb/dotnet-skills) into .claude/skills/akka-hosting-actor-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a codex`. Or copy the skill folder (skills/akka-hosting-actor-patterns in Aaronontheweb/dotnet-skills) into .agents/skills/akka-hosting-actor-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Aaronontheweb/dotnet-skills --skill akka-hosting-actor-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/akka-hosting-actor-patterns, .gemini/skills/akka-hosting-actor-patterns, .github/skills/akka-hosting-actor-patterns and .opencode/skills/akka-hosting-actor-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Akka.Hosting Actor Patterns is instructions for the agent only. Our summary lists: A .NET project using Akka.NET and Akka.Hosting; Akka.Cluster.Sharding for the clustered mode; Akka.Reminders with a SQL provider for durable reminders.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Akka.Hosting Actor Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5k tokens (SKILL.md is roughly 20k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Akka.Hosting Actor Patterns: GitVersion .NET Development (GitTools/GitVersion, 3.1k stars), Dotnet Patterns (affaan-m/ECC, 275k stars), Dotnet Best Practices (github/awesome-copilot, 40k stars) and Dotnet Design Pattern Review (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Aaronontheweb (a GitHub user) maintains it in Aaronontheweb/dotnet-skills, which has 1,203 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on September 17, 2026.
Source: Aaronontheweb/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.