agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-realtime/SKILL.md

shadow-realtime

Skill1 starsChanged yesterdayMITView on GitHub

Realtime Transport & Client Synchronization Engineering. Use when designing WebSockets, Server-Sent Events (SSE), long-lived streams, Last-Event-ID resumption cursors, mid-connection auth revocation, presence accuracy, slow-consumer backpressure, or multi-node pub/sub fan-out. Do NOT use for durable queue semantics (shadow-concurrency), stateless HTTP APIs (shadow-api), or third-party webhooks (shadow-integrate).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Presence Honesty: Document explicit staleness bounds (e.g., heartbeat_interval + grace_window) rather than claiming exact real-time online …

    line 13
  2. Very specific:

    Read methodologies/WEBSOCKET-SSE-RESUMPTION-AND-BACKPRESSURE.md and playbooks/REALTIME-PROTOCOL-ADR-AND-RUNBOOK.md:

    line 16
  3. Very specific:

    Select Transport via ADR: Prefer SSE (EventSource + Last-Event-ID) for server->client feeds behind standard HTTP proxies.

    line 17
  4. Distinctive:

    Configure Multi-Node Fan-Out & Backpressure: Use Redis Pub/Sub / NATS / Kafka fan-out (never in-memory-only arrays behind load balancers).

    line 20
  5. Very specific:

    Simulate Adversarial Disconnects: Test 30-minute offline reconnect, duplicate frame delivery, token revocation mid-stream, and …

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

/shadow-realtime — Realtime Transport & Client Synchronization

  • Owner: Live client connections, protocol choice (WebSocket vs SSE vs Polling), auth renewal/revocation, resumption cursors, deduplication, and backpressure.
  • Boundaries: Durable business job outbox/DLQ (shadow-concurrency), stateless REST (shadow-api), outbound payment/SMTP adapters (shadow-integrate).

1. Preconditions, Security & Accuracy Rules

  • Revocation Gate: A mid-session permission downgrade or token expiration MUST terminate or pause unauthorized event streams immediately — never continue pushing events on a stale socket.
  • Presence Honesty: Document explicit staleness bounds (e.g., heartbeat_interval + grace_window) rather than claiming exact real-time online counts across mobile networks.

2. 6-Step Realtime Engineering Playbook

Read methodologies/WEBSOCKET-SSE-RESUMPTION-AND-BACKPRESSURE.md and playbooks/REALTIME-PROTOCOL-ADR-AND-RUNBOOK.md:

  1. Select Transport via ADR: Prefer SSE (EventSource + Last-Event-ID) for server->client feeds behind standard HTTP proxies; use WebSocket when bidirectional low-latency frames are required; use Polling for low-frequency status updates.
  2. Design Resumption & Deduplication: Attach monotonic sequence/cursor IDs; replay missed bounded history on reconnect or trigger full state resync (snapshot_required) if cursor fell behind retention window.
  3. Enforce Auth & Tenant ACL Per-Subscription: Validate token & tenant ACL at handshake AND on periodic refresh / revocation channel events.
  4. Configure Multi-Node Fan-Out & Backpressure: Use Redis Pub/Sub / NATS / Kafka fan-out (never in-memory-only arrays behind load balancers); bound per-client send queues so one slow consumer drops/resyncs instead of OOMing the server.
  5. Simulate Adversarial Disconnects: Test 30-minute offline reconnect, duplicate frame delivery, token revocation mid-stream, and reverse-proxy idle timeout (proxy_read_timeout vs heartbeat ping).
  6. Verify Observability & Runbook: Track active connections, disconnect reasons, drop rates, and reconnect storms with jittered exponential backoff.
python "shadow-realtime/scripts/realtime_transport_verifier.py" --self-test
python "shadow-realtime/scripts/realtime_transport_verifier.py" --verify-session path/to/session_spec.json

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.