agentleFS
shinzoxDshinzoxD/knackbox/skills/coding/websocket-design/SKILL.md

websocket-design

Skill0 starsChanged 5 months agoApache-2.0View on GitHub

Design WebSocket and realtime channels with auth, backpressure, and

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not treat sockets as free unlimited fan-out.

    line 17
  2. Distinctive:

    Use cases: notifications, collab, trading, presence.

    line 21
  3. Distinctive:

    Document idle timeouts and ping/pong.

    line 45
  4. Distinctive:

    Prefer idempotent event ids for delivery.

    line 46
  5. Distinctive:

    Horizontal scale: avoid single-node presence without store.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WebSocket Design

Realtime needs auth on connect, heartbeats, reconnect/resume, and backpressure. Do not treat sockets as free unlimited fan-out.

Workflow

  1. Use cases: notifications, collab, trading, presence.
  2. Auth: ticket/token on connect; revalidate on resume.
  3. Protocol: message types, versioning, compression.
  4. Scaling: sticky sessions, pub/sub fan-out, room design.
  5. Reliability: heartbeats, backoff reconnect, offline buffer.
  6. Backpressure and max message size.
  7. Observability: connects, drops, lag.

Output format

## Realtime design
**Channels:** …
**Auth:** …
**Message schema:** …
**Reconnect/resume:** …
**Scale plan:** …
**Limits:** …

Rules

  1. Authenticate before subscribing to private rooms.
  2. Validate every client message; never trust client as authority for money.
  3. Document idle timeouts and ping/pong.
  4. Prefer idempotent event ids for delivery.
  5. Separate public broadcast from private streams.

Edge cases

  • Mobile networks: aggressive reconnect.
  • Horizontal scale: avoid single-node presence without store.
  • Browser limits: connection count per origin.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.