Skip to main content
AI/MLCrestApps

crestapps-core-signalr

Skill for centralized SignalR hub path management and real-time chat URL generation in CrestApps.Core.

Stars
13
Source
CrestApps/CrestApps.AgentSkills
Updated
2026-05-29
Slug
CrestApps--CrestApps.AgentSkills--crestapps-core-signalr
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/CrestApps/CrestApps.AgentSkills/HEAD/plugins/crestapps-core/skills/crestapps-core-signalr/SKILL.md -o .claude/skills/crestapps-core-signalr.md

Drops the SKILL.md into .claude/skills/crestapps-core-signalr.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

CrestApps.Core SignalR - Prompt Templates

Add SignalR Support

Register SignalR through the AI-suite builder when it participates in CrestApps composition. The builder overload can also add the store-committer hub filter.

builder.Services.AddCrestAppsCore(crestApps => crestApps
    .AddAISuite(ai => ai
        .AddSignalR(
            pathPrefix: "/tenant-a",
            addStoreCommitterFilter: true)
    )
);

For a host that only needs route management, builder.Services.AddCoreSignalR("/tenant-a") returns the standard ISignalRServerBuilder.

Map a Hub with Minimal Hosting

Resolve the registered HubRouteManager instance and map the hub with its generated path. Do not use StartupBase or a static mapper in a minimal host.

var app = builder.Build();

var hubRouteManager = app.Services.GetRequiredService<HubRouteManager>();
app.MapHub<NotificationHub>(
    hubRouteManager.GetPathByHub<NotificationHub>());

The default hub path is /Communication/Hub/{HubTypeName}. The configured prefix is included by GetPathByHub<T>().

Generate a Client URL

Use the same route-manager instance when generating an absolute URL for a request:

public sealed class ChatEndpoint(HubRouteManager hubRouteManager)
{
    public string GetHubUrl(HttpContext httpContext)
        => hubRouteManager.GetUriByHub<AIChatHub>(httpContext);
}

The route manager uses the current request by default and can use its configured site-base URL resolver when one is supplied to the constructor. Configure a SignalR backplane separately for multi-server deployment.