In short.
Akka.Hosting Actor Patterns is a skill for AI coding assistants helping .NET developers implement entity actors, but its partial examples require application code and compatibility checks. Its central pattern shares message routing between a local parent actor and cluster sharding. Additional examples cover registry markers, time providers, reminders and service lifetimes. No code was executed; compilation, reminder durability and distributed behavior remain unverified. Specific cautions include missing local actor cleanup, inconsistent marker usage across examples and a database-disposal comment unsupported by an explicit save operation.
Researched and written by an AI model and checked by a second AI model. How it works
The selected scope is skills/akka-hosting-actor-patterns in Aaronontheweb/dotnet-skills at commit 5ca5db8cf25566f19d2a5dc53204d4af22b23a0d. The supplied complete-scope manifest contains one selected file, SKILL.md, plus the repository-level LICENSE outside that folder. Other repository skills, referenced dependency-injection material, package documentation and external implementations are excluded. No code was executed; compilation, test behavior, cluster operation, reminder durability and deployment outcomes remain unverified.
The overview
Identity
The resource is skills/akka-hosting-actor-patterns/SKILL.md in Aaronontheweb/dotnet-skills. Its front matter names the skill akka-hosting-actor-patterns and sets user-invocable to false. It contains instructions and C# examples for an assistant working on Akka.Hosting applications. The source folder is [https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-hosting-actor-patterns].
Assessment
The skill is useful for teams that already use Akka.Hosting and want consistent routing across local actor tests and clustered deployments. Its examples connect several practical concerns: actor registration, entity IDs, reminder delivery and dependency injection scopes. Adoption still requires implementation work: domain actors, messages and services are omitted, and no executable project or test results are supplied.
Users
The intended users are .NET developers and their coding assistants building actors for domain objects such as orders, users, subscriptions or invoices. Beginners will need familiarity with C#, actor messages and dependency injection. Experienced Akka.NET developers can use it as a design reference for composing hosting extensions and managing local versus clustered configurations.
Capabilities
The file supplies patterns for creating one child actor per entity, extracting entity IDs from messages, switching between local routing and cluster sharding, composing hosting extensions and retrieving actor references through registry markers. It also demonstrates scheduler-backed ITimeProvider injection, per-message service scopes and direct injection of singleton services.
Reminder examples configure in-memory storage or PostgreSQL storage with retry and delivery settings. Sharding guidance covers cluster roles, distributed-data state storage and the choice of whether to remember entities. These are documented patterns; their runtime behavior was not assessed.
Using it
Requirements
Applying the examples requires a C#/.NET application using Akka.NET, Akka.Hosting and dependency injection. The routing examples reference Akka.Cluster.Sharding, including in local mode; clustered hosting also references Akka.Cluster.Hosting. Reminder examples add Akka.Reminders APIs, with PostgreSQL required for the illustrated SQL configuration.
The file specifies no target framework, package versions, installation commands or compatibility matrix. It also does not identify the namespace or package for ITimeProvider. Supported assistant hosts and their skill-loading requirements are unspecified.
Mechanism
An AkkaExecutionMode value selects LocalTest or Clustered. In LocalTest, GenericChildPerEntityParent uses IMessageExtractor to obtain an entity ID, creates a child when necessary and forwards the extracted message. Messages without an entity ID are silently ignored. In Clustered mode, a hosting extension registers a shard region using the same extractor.
ActorRegistry provides access to the parent or shard region. Reminder resolution maps key prefixes to registered actor references. For scoped services, the actor creates and disposes a dependency injection scope inside each message handler. The time example obtains ITimeProvider from ActorSystem.Scheduler.
Setup
The assistant must load the SKILL.md through a supported skill mechanism; the file provides no host-specific installation procedure. Its user-invocable setting is false, and actual activation behavior depends on the host.
For application integration, supply the omitted domain actors, message contracts and service registrations. Adapt the hosting extensions to the project's dependencies and use consistent registry marker types in both execution modes. The PostgreSQL reminder example additionally needs a connection string, schema and table configuration.
Example
An order application can give each message an OrderId through IWithOrderId. OrderMessageExtractor reads that ID. LocalTest sends the message through a parent that finds or creates the corresponding OrderActor; Clustered uses a shard region. The service example requests an OrderResponse through Ask.
This illustrates the intended routing arrangement, not a complete application. The order actor's behavior, command definitions, response handling and matching registry registrations still need implementation. No example was run.
Assessment & evidence
Limitations
The local parent shows child creation but no idle cleanup or passivation. Sharing an extractor therefore does not establish equivalent entity lifecycles between local and clustered modes. The example described as a singleton uses ordinary actor registration and supplies no cluster-singleton configuration.
Early examples register references under actor classes, while later guidance recommends dedicated marker types. These snippets need reconciliation before services can consistently retrieve the intended reference.
The scope-per-message example comments that DbContext changes are committed when the scope is disposed, but shows no explicit save or transaction commit. That comment does not demonstrate persistence. Package compatibility, compilation, restart recovery and the broader RememberEntities guidance have not been validated through execution.
Reasoning
The architectural value is reducing differences in application routing: both modes use the same entity-ID extraction contract while hosting extensions select the transport arrangement. Local mode removes clustering requirements from tests of actor logic. Such tests cannot establish distributed behavior or recovery in a real cluster.
The lifetime guidance similarly addresses long-lived actors holding scoped services. Creating a scope per message makes the intended disposal boundary explicit, while database persistence still needs its own defined operation.
Alternatives
The file presents configuration alternatives within Akka.Hosting: a local child-per-entity parent for tests or simple scenarios, and cluster sharding for distributed operation. Reminder storage can be in memory for tests or PostgreSQL for the durable-storage example. It supplies no comparison with competing assistant skills or actor frameworks, so their relative suitability is not assessed.
Evidence
The source consists of the skill file and repository-level LICENSE at commit 5ca5db8cf25566f19d2a5dc53204d4af22b23a0d. No companion implementation or test project is included in the supplied scope. The original skill text is available at [https://raw.githubusercontent.com/Aaronontheweb/dotnet-skills/5ca5db8cf25566f19d2a5dc53204d4af22b23a0d/skills/akka-hosting-actor-patterns/SKILL.md].
The accompanying license is available at [https://raw.githubusercontent.com/Aaronontheweb/dotnet-skills/5ca5db8cf25566f19d2a5dc53204d4af22b23a0d/LICENSE]. The evidence supports analysis of the document and its visible code; it contains no execution results.
Access & freshness
Costs
The MIT notice grants its permissions free of charge. The supplied material provides no pricing for an assistant, model usage, hosting, cluster infrastructure, database operation or support. Total operating cost is unknown, and no resource-consumption estimates or measurements are supplied.
Rights
The repository-level MIT License names Aaron Stannard as the 2025 copyright holder. It permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions. It disclaims warranties and liability.
Retain that notice when redistributing the skill. The supplied license does not establish the licensing terms of the external packages referenced by its examples.
Freshness
The supplied snapshot was captured on 2026-11-16 at 00:37:27.813 UTC and is pinned to commit 5ca5db8cf25566f19d2a5dc53204d4af22b23a0d. That timestamp establishes the capture date, not the document's publication date. Changes after this revision and compatibility with current dependency releases are unknown.
Actions
Before adopting the examples, establish dependency versions and compile a minimal application with the missing actor and message types. Make registry markers consistent across execution modes, define database save behavior explicitly and decide how local child actors should be removed.
Check entity-ID routing and unknown-message handling locally, then use cluster integration tests for distributed behavior. If reminders are needed, verify callback routing, retries and restart recovery with the intended storage. Preserve the MIT notice with redistributed copies.
