Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/BetterTyped/hype-stackWrote 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.
[](https://agentmods.dev/rules/bettertyped/hype-stack/websockets)<a href="https://agentmods.dev/rules/bettertyped/hype-stack/websockets"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/websockets/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.
<a href="https://agentmods.dev/rules/bettertyped/hype-stack/websockets"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/websockets.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01561 |
| Opus 5 | $0.00000 | $0.00781 |
| Sonnet 5 | $0.00000 | $0.00312 |
| Haiku 4.5 | $0.00000 | $0.00156 |
Grade A, and why
websockets 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
WebSockets
One socket per client app, typed end to end. The backend declares events with SocketRouter, the type bridge in src/types/hono/hono-ws-converter.ts turns those declarations into WsSocketSdk, and the client consumes them through socketSdk. No topic string is written twice and nothing is wired by hand.
How a connection works
src/api/client.tsopens the socket once, at import time, next to the HTTPclient:new Socket({ url: \${wsProtocol}://${wsHost}/ws` }). Admin opens a second one on/ws/admin. HyperFetch reconnects on its own. Never hand-rollnew WebSocket` or a retry loop.- Every frame is JSON
{ topic, data }. Topics are<prefix>/<event>(notification/new,board/op): the prefix comes from.socket("/notification", ...), the event from.emitter()or.listener(). - The backend serves the upgrade at
/ws(createWsRoutes) and callsauthenticate(headers)inonOpen.nullcloses the socket with code 4001. The browser sends the session cookie with the upgrade, so socket auth reuses the HTTP session and nothing goes in the URL. - Connections live in a
ConnectionManagerper namespace (appWsManagerfor/ws,adminWsManagerfor/ws/admin), keyed by user id with the organization id alongside. That registry is whattoUser,toOrganization, andbroadcastwalk. Namespaces never see each other's connections. initWebSocket(app)runs before the routes andserveWebsockets(server)afterserve()inmain.ts. Both are already there. Do not add a secondcreateNodeWebSocket.
Backend: declare events
Event definitions live in src/sockets/<domain>/index.ts, next to but separate from HTTP routes:
import { createSocketRouter } from "@backend/libs/websocket/socket-router";
import { wsValidate } from "@backend/libs/websocket/ws-validate";
import { z } from "zod";
export type WsNotificationPayload = { id: string; title: string; readAt: string | null };
export const notificationSockets = createSocketRouter()
.emitter("new")<WsNotificationPayload>()
.listener("mark-read", wsValidate(z.object({ notificationId: z.string() })), async (c) => {
await markRead({ notificationId: c.data.notificationId, userId: c.userId });
});
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.
- yesterday First seen · 101 lines · 0 tokens per session scan A 9a7b8f1a96ff
websockets is a cursor rule published in the GitHub repository BetterTyped/hype-stack (6 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,561 tokens. 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-11.
Other cursor rules, from other repositories
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
manual-review.backend
The obligations, predicates, evidence schema, failure handling, and review timing in this source are shared. Concrete browser, dispatch, question, filesystem, and command mechanics are target-native and MUST come from the selected runtime fragment at the matching adapter path. A fragment declares only the capability…
create-a-testable-http-client-service
Cursor rule "create-a-testable-http-client-service" from PaulJPhilp/EffectPatterns, covering create a testable http client service, example, 1. define the service, 2. create the live implementation and 3. create the test implementation.
architecture
This document outlines the fundamental architectural principles and patterns for the mcp-debug codebase. Adherence to these guidelines is mandatory to maintain a clean, decoupled, and testable system.
issues-tests
Backend test conventions — QuarkusTest, REST Assured, Given, ArchUnit.
api-design
API design guidelines — REST principles, GraphQL patterns, versioning, pagination, error handling, documentation, security, caching, and testing. Applied when designing or reviewing API endpoints.