/arbiter-skills:arbiter-messaging-webpubsubfrom arbiter-skills
Integrates Arbiter with Azure Web PubSub for publishing JSON messages to hub groups, writing hosted listener processors, and enabling distributed HybridCache expiration over Web PubSub.
Ships in arbiter-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bridges Arbiter to Azure Web PubSub hubs and groups. Hubs and groups are ephemeral, so no durable entity has to be provisioned or cleaned up per application instance — useful for fan-out scenarios such as distributed cache invalidation.
dotnet add package Arbiter.Messaging.WebPubSub
Requires Azure.Messaging.WebPubSub and Azure.Messaging.WebPubSub.Client (transitive).
using Arbiter.Messaging.WebPubSub;
services.AddWebPubSub(
serviceName: null, // optional logical key
nameOrConnectionString: "WebPubSub", // config key OR raw connection string
configureHubs: hubs => hubs
.AddHub("notifications") // hub only
.AddHub("cacheExpire", "app-instance")); // hub plus the groups listeners join
Identity-based authentication uses the TokenCredential overload:
services.AddWebPubSub(
serviceName: null,
endpoint: "https://my-service.webpubsub.azure.com",
credential: new DefaultAzureCredential(),
configureHubs: hubs => hubs.AddHub("notifications"));
nameOrConnectionString is resolved first as a ConnectionStrings:<name> key, then as a root configuration value, then as a literal value.
A WebPubSubServiceClient is registered as a keyed singleton per declared hub name.
public sealed class UserCreatedPublisher(WebPubSubHubContext context)
: WebPubSubPublisherBase(context)
{
public Task PublishAsync(UserCreated message, CancellationToken cancellationToken = default)
=> PublishToGroupAsJsonAsync(
"app-instance",
message,
UserCreatedSerializerContext.Default.UserCreated,
cancellationToken);
}
services.AddWebPubSubPublisher<UserCreatedPublisher>(
serviceName: null,
hubName: "notifications",
groups: ["app-instance"]);
WebPubSubPublisherBase receives a resolved WebPubSubHubContext, so derived publishers use formatted hub and group names without resolving keyed service clients directly.
Derive from WebPubSubProcessorBase and register it; it runs as an IHostedService that connects on host start, joins the configured groups, and disposes on stop:
public sealed class UserCreatedProcessor : WebPubSubProcessorBase
{
public UserCreatedProcessor(
WebPubSubHubContext context,
IHostApplicationLifetime lifetime,
ILogger<UserCreatedProcessor> logger)
: base(context, lifetime, logger) { }
protected override async Task ProcessGroupMessageAsync(WebPubSubGroupMessageEventArgs args)
{
var message = args.ReadFromJson<UserCreated>();
// ...
}
protected override Task ProcessServerMessageAsync(WebPubSubServerMessageEventArgs args)
=> Task.CompletedTask;
}
services.AddWebPubSubProcessor<UserCreatedProcessor>(serviceName: null, hubName: "notifications");
When no groups are passed, the groups declared for the hub in AddWebPubSub are used.
// Both publisher and subscriber
services.AddWebPubSubCacheExpire(
serviceName: null,
hubName: "cacheExpire",
groupName: "app-instance");
AddWebPubSubCacheExpirePublisher and AddWebPubSubCacheExpireSubscriber register the halves independently. The publisher expires the local HybridCache first, then publishes a CacheExpireMessage; the subscriber skips messages carrying its own SourceId.
^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$ — WebPubSubOptions.NameSuffix is appended with an underscore. GroupSuffix uses a hyphen.Arbiter.Messaging.ServiceBus when guaranteed delivery is required.CacheExpireProcessor.WebPubSubTelemetry.SourceName with OpenTelemetry, or use Arbiter.OpenTelemetry.Server, to collect
producer and consumer spans.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
arbiter, azure-web-pubsub, messaging, distributed-cache, hybridcache
npx claudepluginhub loresoft/arbiter --plugin arbiter-skills14 skills in this plugin
/arbiter-commandqueryUse when working with Arbiter's CQRS base layer — EntityQuery, EntityFilter, FilterOperators, SortDirections, EntityPagedQuery, EntityIdentifierQuery, EntityCreateCommand / EntityUpdateCommand / EntityPatchCommand / EntityDeleteCommand, or pipeline behaviors like validation, hybrid cache, audit, tenant, soft-delete. Trigger on AddCommandQuery, AddCommandValidation, AddEntityHybridCache./arbiter-commandquery-efUse when wiring Arbiter.CommandQuery with Entity Framework Core — registering AddEntityQueries / AddEntityCommands / AddQueryPipeline for an entity, defining DbContext-backed handlers, or implementing audited / soft-delete / tenant entities for EF Core./arbiter-commandquery-mongoUse when wiring Arbiter.CommandQuery with MongoDB — AddMongoRepository plus AddEntityQueries / AddEntityCommands for an IMongoEntityRepository<TEntity>. Trigger on IMongoRepository, IMongoEntityRepository, MongoDB document handlers./arbiter-communicationUse when sending templated email or SMS via Arbiter.Communication — AddEmailServices / AddSmsServices, IEmailDeliveryService / ISmsDeliveryService, template resolvers, or wiring a delivery provider like Azure Communication Services, Microsoft Graph, SendGrid, Twilio, or SMTP./arbiter-dispatcherUse when wiring the Blazor IDispatcher abstraction from Arbiter.Dispatcher — MessagePackDispatcher / JsonDispatcher for WebAssembly, ServerDispatcher for Server Interactive, AddDispatcherService + MapDispatcherService on the host, or component state helpers ModelStateManager / ModelStateLoader / ModelStateEditor. Trigger on Blazor Auto render mode setup./arbiter-endpointsUse when exposing Arbiter commands and queries as REST via Minimal APIs — AddEndpointRoutes, MapEndpointRoutes, EntityCommandEndpointBase, EntityQueryEndpointBase, IEndpointRoute. Trigger on Minimal API endpoint registration for CRUD entities.Other plugins' skills for the same job