Agent skill

Signalr

by managedcode in managedcode/dotnet-skills

Implement or review SignalR hubs, streaming, reconnection, transport, and real-time delivery patterns in ASP.NET Core applications.

MITAuto-check passedBackend & APIs

Install Signalr

skills CLI
$ npx skills add managedcode/dotnet-skills --skill signalr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install managedcode/dotnet-skills signalr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Frameworks/SignalR/skills/signalr .claude/skills/signalr && rm -rf skills-src

Use ~/.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/

Facts

Skill name
signalr
GitHub stars
486
Token cost
~3.2k tokens
SKILL.md length
697 words
Files
4 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Implement or review SignalR hubs, streaming, reconnection, transport, and real-time delivery patterns in ASP.NET Core applications.

  • Works in 6 steps: Use SignalR for broadcast-style or… → Model hub contracts intentionally and… → Plan for reconnection, backpressure,… → …
  • : building chat
  • SKILL.md covers Trigger On, Documentation, Workflow and Current Upstream Notes, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Signalr is an agent skill from managedcode/dotnet-skills. Implement or review SignalR hubs, streaming, reconnection, transport, and real-time delivery patterns in ASP.NET Core applications. USE FOR: building chat, notification, collaboration, or live-update features; debugging hub lifetime, connection state, or transport issues; deciding whether SignalR or another. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation…

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `manifest.json`, `references/anti-patterns.md` and `references/patterns.md`). Compatibility notes: Requires ASP.NET Core SignalR server or client code.

It sits in Backend & APIs, covering Realtime and WebSockets and Codebase knowledge for agents. It works with ASP.NET Core. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • : building chat
  • Live-update features
  • Debugging hub lifetime
  • Connection state

Example prompts

  • “/signalr”

Requirements

  • Compatibility (from SKILL.md): Requires ASP.NET Core SignalR server or client code.

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Use SignalR for broadcast-style or connection-oriented real-time features; do not force gRPC into hub-style fan-out scenarios.
  2. Model hub contracts intentionally and keep hub methods thin, delegating durable work elsewhere.
  3. Plan for reconnection, backpressure, auth, and fan-out costs instead of treating real-time messaging as stateless request/response.
  4. Use groups, presence, and connection metadata deliberately so scale-out behavior is understandable.
  5. If Native AOT or trimming is in play, validate supported protocols and serialization choices explicitly.
  6. Test connection behavior and failure modes, not just happy-path message delivery.

What it can do on your machine

Read from SKILL.md and the folder at commit 535dd55. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp and javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires ASP.NET Core SignalR server or client code.

    From compatibility in the SKILL.md frontmatter.

Context cost

Signalr loads about 3.2k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 138 tokens; SKILL.md has 697 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~138
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 697 words, ~3,213 tokens.

Download SKILL.mdSave it as .claude/skills/signalr/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
signalr
description
Implement or review SignalR hubs, streaming, reconnection, transport, and real-time delivery patterns in ASP.NET Core applications. USE FOR: building chat, notification, collaboration, or live-update features; debugging hub lifetime, connection state, or transport issues; deciding whether SignalR or another. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
compatibility
Requires ASP.NET Core SignalR server or client code.

SignalR

Trigger On

  • building chat, notification, collaboration, or live-update features
  • debugging hub lifetime, connection state, or transport issues
  • deciding whether SignalR or another transport better fits the scenario
  • implementing real-time broadcasting to groups of connected clients
  • scaling SignalR across multiple servers

Documentation

References
  • patterns.md - Detailed hub patterns, streaming, groups, presence, and advanced messaging techniques
  • anti-patterns.md - Common SignalR mistakes and how to avoid them

Workflow

  1. Use SignalR for broadcast-style or connection-oriented real-time features; do not force gRPC into hub-style fan-out scenarios.
  2. Model hub contracts intentionally and keep hub methods thin, delegating durable work elsewhere.
  3. Plan for reconnection, backpressure, auth, and fan-out costs instead of treating real-time messaging as stateless request/response.
  4. Use groups, presence, and connection metadata deliberately so scale-out behavior is understandable.
  5. If Native AOT or trimming is in play, validate supported protocols and serialization choices explicitly.
  6. Test connection behavior and failure modes, not just happy-path message delivery.

Current Upstream Notes

  • dotnet/aspnetcore v10.0.11 is a servicing release and does not change the SignalR programming model. Keep guidance focused on hub contract design, reconnection, transport, authorization, and scale-out validation.
  • The August 2026 ASP.NET Core overview still positions SignalR for real-time server/client communication. After servicing updates, rerun at least one reconnect and group-broadcast smoke path because dependency updates can expose client/server package mismatches.

Hub Patterns

csharp
// Define the client interface
public interface IChatClient
{
    Task ReceiveMessage(string user, string message);
    Task UserJoined(string user);
    Task UserLeft(string user);
}

// Implement the strongly-typed hub
public class ChatHub : Hub<IChatClient>
{
    public async Task SendMessage(string user, string message)
    {
        // Compiler checks client method calls
        await Clients.All.ReceiveMessage(user, message);
    }

    public override async Task OnConnectedAsync()
    {
        await Clients.Others.UserJoined(Context.User?.Identity?.Name ?? "Anonymous");
        await base.OnConnectedAsync();
    }

    public override async Task OnDisconnectedAsync(Exception? exception)
    {
        await Clients.Others.UserLeft(Context.User?.Identity?.Name ?? "Anonymous");
        await base.OnDisconnectedAsync(exception);
    }
}
Using Groups for Targeted Messaging
csharp
public class NotificationHub : Hub<INotificationClient>
{
    public async Task JoinGroup(string groupName)
    {
        await Groups.AddToGroupAsync(Context.ConnectionId, groupName);
        await Clients.Group(groupName).UserJoined(Context.User?.Identity?.Name);
    }

    public async Task LeaveGroup(string groupName)
    {
        await Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
    }

    public async Task SendToGroup(string groupName, string message)
    {
        await Clients.Group(groupName).ReceiveNotification(message);
    }
}
Hub Method with Custom Object Parameters (API Versioning)
csharp
// Use custom objects to avoid breaking changes
public class SendMessageRequest
{
    public string Message { get; set; } = string.Empty;
    public string? Recipient { get; set; }  // Added later without breaking clients
    public int? Priority { get; set; }       // Added later without breaking clients
}

public class ChatHub : Hub<IChatClient>
{
    public async Task SendMessage(SendMessageRequest request)
    {
        // Handle both old and new clients
        if (request.Recipient != null)
        {
            await Clients.User(request.Recipient).ReceiveMessage(request.Message);
        }
        else
        {
            await Clients.All.ReceiveMessage(request.Message);
        }
    }
}

Client Patterns

JavaScript Client with Automatic Reconnection
javascript
const connection = new signalR.HubConnectionBuilder()
    .withUrl("/chatHub")
    .withAutomaticReconnect([0, 2000, 5000, 10000, 30000]) // Retry delays
    .configureLogging(signalR.LogLevel.Information)
    .build();

// Handle reconnection events
connection.onreconnecting(error => {
    console.log("Reconnecting...", error);
    updateUIForReconnecting();
});

connection.onreconnected(connectionId => {
    console.log("Reconnected with ID:", connectionId);
    // Rejoin groups - reconnection does not restore group membership
    rejoinGroups();
    updateUIForConnected();
});

connection.onclose(error => {
    console.log("Connection closed", error);
    updateUIForDisconnected();
});

async function start() {
    try {
        await connection.start();
        console.log("SignalR Connected");
    } catch (err) {
        console.log(err);
        setTimeout(start, 5000);
    }
}

start();
.NET Client with Reconnection
csharp
var connection = new HubConnectionBuilder()
    .WithUrl("https://localhost:5001/chatHub", options =>
    {
        options.AccessTokenProvider = () => Task.FromResult(GetAccessToken());
    })
    .WithAutomaticReconnect()
    .Build();

connection.Reconnecting += error =>
{
    _logger.LogWarning("Connection lost. Reconnecting: {Error}", error?.Message);
    return Task.CompletedTask;
};

connection.Reconnected += connectionId =>
{
    _logger.LogInformation("Reconnected with ID: {ConnectionId}", connectionId);
    // Rejoin groups after reconnection
    return RejoinGroupsAsync();
};

connection.Closed += async error =>
{
    _logger.LogError("Connection closed: {Error}", error?.Message);
    await Task.Delay(Random.Shared.Next(0, 5) * 1000);
    await connection.StartAsync();
};

await connection.StartAsync();

Server Configuration

Hub Registration with Authentication
csharp
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddSignalR(options =>
{
    options.EnableDetailedErrors = builder.Environment.IsDevelopment();
    options.MaximumReceiveMessageSize = 64 * 1024; // 64 KB
    options.StreamBufferCapacity = 10;
    options.KeepAliveInterval = TimeSpan.FromSeconds(15);
    options.ClientTimeoutInterval = TimeSpan.FromSeconds(30);
})
.AddMessagePackProtocol(); // Binary protocol for performance

builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddJwtBearer(options =>
    {
        options.Events = new JwtBearerEvents
        {
            OnMessageReceived = context =>
            {
                // Read token from query string for WebSocket connections
                var accessToken = context.Request.Query["access_token"];
                var path = context.HttpContext.Request.Path;
                if (!string.IsNullOrEmpty(accessToken) && path.StartsWithSegments("/hubs"))
                {
                    context.Token = accessToken;
                }
                return Task.CompletedTask;
            }
        };
    });

var app = builder.Build();

app.UseAuthentication();
app.UseAuthorization();

app.MapHub<ChatHub>("/hubs/chat");
Sending Messages from Outside a Hub
csharp
public class NotificationService
{
    private readonly IHubContext<NotificationHub, INotificationClient> _hubContext;

    public NotificationService(IHubContext<NotificationHub, INotificationClient> hubContext)
    {
        _hubContext = hubContext;
    }

    public async Task NotifyAllAsync(string message)
    {
        await _hubContext.Clients.All.ReceiveNotification(message);
    }

    public async Task NotifyUserAsync(string userId, string message)
    {
        await _hubContext.Clients.User(userId).ReceiveNotification(message);
    }

    public async Task NotifyGroupAsync(string groupName, string message)
    {
        await _hubContext.Clients.Group(groupName).ReceiveNotification(message);
    }
}

Scaling with Redis Backplane

csharp
builder.Services.AddSignalR()
    .AddStackExchangeRedis(connectionString, options =>
    {
        options.Configuration.ChannelPrefix = RedisChannel.Literal("MyApp");
    });

Anti-Patterns to Avoid

Anti-PatternWhy It's BadBetter Approach
Storing state in Hub propertiesHub instances are created per method callUse IMemoryCache, database, or external store
Instantiating Hub directlyBypasses SignalR infrastructureUse IHubContext<THub> for external messaging
Not awaiting SendAsync callsMessages may not be sent before hub method completesAlways await async hub calls
Adding method parameters without versioningBreaking change for existing clientsUse custom object parameters
Ignoring reconnection group lossClients lose group membership on reconnectRe-add to groups in OnConnectedAsync or client reconnect handler
Large payloads over SignalRMemory pressure, bandwidth issuesUse REST/gRPC for bulk data, SignalR for notifications
Missing backplane in multi-serverMessages only reach clients on same serverUse Redis backplane or Azure SignalR Service
Exposing ORM entities directlyMay serialize sensitive dataUse DTOs with explicit properties
Not validating incoming messagesSecurity risk after initial authValidate every hub method input
Show full SKILL.md (269 more words)Show less

Best Practices

Connection Management
  1. Enable automatic reconnection with exponential backoff delays
  2. Handle group rejoining explicitly after reconnection (connection ID changes)
  3. Implement heartbeat monitoring on the client to detect stale connections
  4. Use sticky sessions when scaling across multiple servers (unless using Azure SignalR Service)
Performance
  1. Use MessagePack protocol for smaller message sizes and faster serialization
  2. Throttle high-frequency events like typing indicators or mouse movements
  3. Batch messages when possible instead of many small sends
  4. Set appropriate buffer sizes based on expected message throughput
Security
  1. Authenticate at connection time using JWT tokens via query string
  2. Authorize hub methods using [Authorize] attribute
  3. Validate all incoming messages even after authentication
  4. Use HTTPS for all SignalR connections
API Design
  1. Use strongly-typed hubs to catch client method name typos at compile time
  2. Use custom object parameters to enable backward-compatible API evolution
  3. Version hub names (e.g., ChatHubV2) for breaking changes
  4. Keep hub methods thin and delegate business logic to services
Observability
  1. Log connection events (connect, disconnect, reconnect)
  2. Track transport type used by each connection
  3. Monitor message delivery latency and failure rates
  4. Integrate with Application Insights or other APM tools

Deliver

  • clear hub contracts and connection behavior
  • real-time delivery that matches the product scenario
  • validation for reconnection and authorization flows
  • appropriate scale-out strategy for multi-server deployments

Validate

  • SignalR is the correct transport for the use case
  • hub methods remain orchestration-oriented
  • group and auth behavior are explicit and tested
  • reconnection and group membership are handled correctly
  • backplane is configured for multi-server scenarios
  • message validation is implemented in hub methods

© managedcode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in catalog/Frameworks/SignalR/skills/signalr of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/anti-patterns.md
  • references/patterns.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

Signalr 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.

Signalr compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Signalr this skillmanagedcode/dotnet-skills486—~3.2kAutomated safety check: PassMIT
Tsp Csharpquerylenshq/ef-querylens225—~1.3kAutomated safety check: PassMIT
Lua Ecozhaojh329/lua-eco103—~1.7kAutomated safety check: PassMIT
Classcadawv-informatik/classcad-ai108—~12kAutomated safety check: PassMIT
Dev Rulesrust-dd/tako162—~810Automated safety check: PassMIT
System Bridge Go Backendtimmo001/system-bridge356—~841Automated safety check: PassApache-2.0

Similar skills

  • Tsp Csharp

    querylenshq/ef-querylens

    Comprehensive C and .NET development skill for TSP projects.

    225 GitHub stars~1.3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Lua Eco

    zhaojh329/lua-eco

    International lua-eco public API skill for writing, reviewing, explaining, and fixing Lua 5.4 code that runs on the eco runtime.

    103 GitHub stars~1.7k tokensUpdated 7 days ago
    Backend & APIsAuto-check passed
  • Classcad

    awv-informatik/classcad-ai

    Structured API reference for the ClassCAD headless parametric CAD engine (v1 JSON/WebSocket API).

    108 GitHub stars~12k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Dev Rules

    rust-dd/tako

    General coding-style rules to apply to every project. An agent skill from rust-dd/tako.

    162 GitHub stars~810 tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • System Bridge Go Backend

    timmo001/system-bridge

    System Bridge Go backend conventions - error wrapping, graceful degradation for data modules, nil-pointer safety, context-aware Module.Update, structured slog logging, and errcheck-clean deferred…

    356 GitHub stars~841 tokensUpdated today
    Backend & APIsAuto-check passed
  • Debug Logs

    adam-s/intercept

    Iterative debugging with targeted logs. An agent skill from adam-s/intercept.

    189 GitHub stars~1.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Questions about Signalr

What does Signalr do?

Implement or review SignalR hubs, streaming, reconnection, transport, and real-time delivery patterns in ASP.NET Core applications. Signalr is an agent skill from managedcode/dotnet-skills.NET Core applications.

When should I use Signalr?

Signalr fits situations like: : building chat; live-update features; debugging hub lifetime; connection state.

How do I install Signalr in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill signalr -a claude-code`. Or copy the skill folder (catalog/Frameworks/SignalR/skills/signalr in managedcode/dotnet-skills) into .claude/skills/signalr in your project. Claude Code loads it when a task matches its description.

How do I install Signalr in Codex?

Run `npx skills add managedcode/dotnet-skills --skill signalr -a codex`. Or copy the skill folder (catalog/Frameworks/SignalR/skills/signalr in managedcode/dotnet-skills) into .agents/skills/signalr in your project. Codex loads it when a task matches its description.

Can I use Signalr in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add managedcode/dotnet-skills --skill signalr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/signalr, .gemini/skills/signalr, .github/skills/signalr and .opencode/skills/signalr in your project.

What does Signalr need to run?

SKILL.md names no scripts, command-line tools or credentials: Signalr is instructions for the agent only. Compatibility (from SKILL.md): Requires ASP.NET Core SignalR server or client code..

Does Signalr access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is Signalr safe to install?

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.

What licence does Signalr use?

Signalr is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Signalr use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to Signalr?

Skills that share tags, products or a category with Signalr: Tsp Csharp (querylenshq/ef-querylens, 225 stars), Lua Eco (zhaojh329/lua-eco, 103 stars), Classcad (awv-informatik/classcad-ai, 108 stars) and Dev Rules (rust-dd/tako, 162 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Signalr?

managedcode (a GitHub organization) maintains it in managedcode/dotnet-skills, which has 486 GitHub stars. The repository holds 81 skills in this directory. The repository was last updated on October 7, 2026.

Source: managedcode/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.