CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/realtime-web-patterns

WebSocket vs SSE vs polling, reconnection with backoff and jitter, heartbeats, backpressure, message ordering, connection state UI, auth on upgrade, graceful degradation

94

1.87x
Quality

98%

Does it follow best practices?

Impact

90%

1.87x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

reconnection-handled.jsonverifiers/

{
  "instruction": "Handle connection loss and reconnection for real-time transports",
  "relevant_when": "Agent implements WebSocket, SSE, or real-time features including live updates, chat, notifications, dashboards, or streaming data",
  "context": "Connections drop due to network issues, server restarts, and proxy timeouts. The client must reconnect automatically with exponential backoff and jitter. Without this, users see stale data after network blips. After reconnection, the client must recover state by re-subscribing to rooms and re-fetching current data.",
  "sources": [
    {
      "type": "file",
      "filename": "skills/realtime-web-patterns/SKILL.md",
      "tile": "tessl-labs/realtime-web-patterns@0.2.0"
    }
  ],
  "checklist": [
    {
      "name": "reconnect-logic-exists",
      "rule": "Client-side code handles connection loss and attempts to reconnect automatically, either via EventSource (built-in), Socket.IO reconnection config, or manual WebSocket reconnection logic",
      "relevant_when": "Agent implements real-time client connection"
    },
    {
      "name": "exponential-backoff-with-jitter",
      "rule": "Reconnection uses exponential backoff (e.g., 1s, 2s, 4s, 8s...) with a maximum cap (e.g., 30s) and random jitter to avoid thundering herd. Fixed delays or immediate reconnection are not acceptable.",
      "relevant_when": "Agent implements WebSocket reconnection (not SSE, which handles this automatically)"
    },
    {
      "name": "state-recovery-on-reconnect",
      "rule": "After reconnection, client re-subscribes to rooms/channels and re-fetches current state to fill gaps from the disconnect period. Simply reconnecting without state recovery leaves the UI stale.",
      "relevant_when": "Agent implements real-time client that subscribes to specific resources or rooms"
    },
    {
      "name": "dispose-guard",
      "rule": "Reconnection logic has a dispose/cleanup mechanism so that unmounted components or closed pages do not keep reconnecting forever",
      "relevant_when": "Agent implements WebSocket reconnection in a component-based framework"
    }
  ]
}

tile.json