unraid-management-agent: Command for GitHub Copilot

.github/prompts/Add WebSocket Event.prompt.md

Add WebSocket Event is a command for GitHub Copilot from ruaan-deysel/unraid-management-agent. It costs 12 tokens per session (393 once invoked), scanned A, original, MIT.

A step-by-step guide for adding a WebSocket event, which lets a server send live updates to connected clients.

In plain words
What is it for?
Use it when adding a real-time update to a Go service, including its event topic, server handling, JSON shape, and client broadcast.
Why use it?
It removes the need to work out where to define, publish, subscribe to, format, and test a new live event.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

This is ruaan-deysel/unraid-management-agent's own configuration. It tells GitHub Copilot how to work on unraid-management-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unraid-management-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ruaan-deysel/unraid-management-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ruaan-deysel/unraid-management-agent/main/.github/prompts/Add WebSocket Event.prompt.md
Clone the repo
git clone --depth 1 https://github.com/ruaan-deysel/unraid-management-agent

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Add WebSocket Event

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruaan-deysel/unraid-management-agent/add-websocket-event/github.svg)](https://agentmods.dev/commands/ruaan-deysel/unraid-management-agent/add-websocket-event)
Your own site
<a href="https://agentmods.dev/commands/ruaan-deysel/unraid-management-agent/add-websocket-event"><img src="https://agentmods.dev/badge/commands/ruaan-deysel/unraid-management-agent/add-websocket-event/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Add WebSocket Event

Your own site · 80×15
<a href="https://agentmods.dev/commands/ruaan-deysel/unraid-management-agent/add-websocket-event"><img src="https://agentmods.dev/badge/commands/ruaan-deysel/unraid-management-agent/add-websocket-event.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 393 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.00393
Opus 5 $0.00006 $0.00197
Sonnet 5 $0.00002 $0.00079
Haiku 4.5 $0.00001 $0.00039

Measured 3d ago against content hash 1350099bbb4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

Add WebSocket Event scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/Add WebSocket Event.prompt.md · 75 lines

What it actually says

Add a New WebSocket Event

Follow these steps to add a new real-time WebSocket broadcast event.

Step 1: Define the Event Topic

Add a topic constant in daemon/constants/const.go:

const MyFeatureUpdateTopic = "my_feature_update"

Step 2: Ensure Collector Publishes

The collector must publish data to the event bus:

c.ctx.Hub.Pub(data, constants.MyFeatureUpdateTopic)

If no collector exists yet, follow the "Add Collector" prompt.

Step 3: Subscribe in API Server

In daemon/services/api/server.go subscribeToEvents():

  1. Add the topic to the Hub.Sub() call:
sub := s.ctx.Hub.Sub(
    "system_update",
    "my_feature_update",  // Add here
    // ... other topics
)
  1. Add a case in the switch statement:
case dto.MyFeatureInfo:
    s.cacheMutex.Lock()
    s.myFeatureCache = v
    s.cacheMutex.Unlock()
    s.broadcastToClients("my_feature_update", v)

Step 4: WebSocket Event Format

Events are broadcast to clients as dto.WSEvent:

{
  "event": "my_feature_update",
  "timestamp": "2025-01-01T00:00:00Z",
  "data": {
    /* DTO fields */
  }
}

Step 5: Test

  • Verify the event is broadcast by connecting a WebSocket client
  • Add tests if there's specific transformation logic

Step 6: Document

  • Update WebSocket events documentation in docs/api/websocket-events.md
  • Update CHANGELOG.md
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 75 lines · 12 tokens per session scan A 1350099bbb4d

Subscribe to this mod's changes

Add WebSocket Event is a command published in the GitHub repository ruaan-deysel/unraid-management-agent (53 stars, last pushed 2d ago), licensed MIT. It adds 12 tokens to every session and 393 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.