Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Realtime Sync

  • 67 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

realtime-sync is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • realtime-sync
  • AI & Agent Building
  • AI-coding skill

Realtime Sync by the numbers

  • 67 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #5,935 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill realtime-sync

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs67
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Realtime Sync

Overview

Architects high-concurrency, sub-50ms latency synchronization between distributed clients and servers. Covers WebTransport (HTTP/3) bidirectional streaming, transactional outbox patterns for database-to-sync consistency, CRDTs for collaborative editing, and AI token stream orchestration.

Core principles: the database is the source of truth (real-time channels notify, not persist), CRDTs eliminate locking for concurrent edits, and backpressure management prevents UI jitter from high-frequency streams.

When to use: Real-time collaborative UIs, pub/sub messaging, WebTransport/WebSocket connections, live AI token streams, presence tracking, conflict resolution with CRDTs, multiplayer applications.

When NOT to use: Batch processing pipelines, static content delivery, request-response APIs without real-time requirements, offline-only applications.

Quick Reference

PatternApproachKey Points
WebTransportnew WebTransport(url) + await readyHTTP/3 multiplexed; replaces WebSockets for new projects
Bidirectional streamtransport.createBidirectionalStream()Returns { readable, writable } for request-response
Unidirectional streamtransport.createUnidirectionalStream()Returns a WritableStream directly for one-way pushes
Datagramstransport.datagrams.writableUDP-like unreliable delivery for high-frequency state
Connection statstransport.getStats()Returns smoothedRtt, bytesSent, packetsLost
Transactional outboxDB write + outbox insert in one transactionCDC worker pushes to channel; prevents state drift
Sequence trackingSequence IDs on every messageRewind on reconnect to fetch missed messages
CRDT collaborationYjs (text) or Automerge (JSON state)Conflict-free concurrent editing without locks
CRDT awarenessy-protocols/awareness moduleTracks cursors, selections, and user presence
CRDT undo/redoY.UndoManager with trackedOriginsTracks only local user operations for selective undo
PresenceHeartbeat-based user trackingEpidemic broadcast for reliable zombie cleanup
AI stream batchingrequestAnimationFrame for token renderingPrevents UI jitter from high-frequency updates
Buffer-and-batchuseTransition for sync-triggered updatesDefers non-urgent re-renders during sync bursts
BackpressureBuffer size limit with forced flushPrevents memory buildup when tokens outpace rendering
WebSocket fallbackDetect WebTransport support firstEnterprise firewalls may block UDP/HTTP/3
SerializationProtocol Buffers or MessagePackAvoid JSON.stringify on 100Hz+ streams
Web Worker transportHandle WebTransport in a Web WorkerPrevents blocking the UI thread
Channel multiplexingSubscribe to multiple channels on one socketAll subscriptions share a single transport connection

Common Mistakes

MistakeCorrect Pattern
Using real-time messages as the primary source of truthState lives in the database; real-time is the notification of change
Using JSON.stringify on high-frequency streams (100Hz+)Use Protocol Buffers or MessagePack for serialization
Ignoring sequence drift when a client misses messagesImplement Sequence IDs and a rewind mechanism on the client
Implementing global locks for concurrent accessUse Optimistic UI and CRDTs for conflict-free collaboration
Sticking with WebSockets for new projects needing multiplexingUse WebTransport (HTTP/3) for bidirectional, multiplexed streams
CRDT document bloat from unbounded historyUse snapshotting (LWW) for fields that do not need history
Failing to close WebTransport streams on unmountExplicitly close streams to prevent transport crashes
Importing Awareness from yjs instead of y-protocolsUse import { Awareness } from 'y-protocols/awareness'
Using ydoc.clientID as UndoManager tracked originUse custom transaction origins passed to doc.transact()
One React re-render per AI token receivedBatch tokens with requestAnimationFrame and flush once per frame
Not handling WebTransport closed promiseMonitor transport.closed to detect unexpected disconnections

Delegation

If the local-first skill is available, delegate local-first architecture decisions, sync engine comparison, and client storage selection to it.
If the electricsql skill is available, delegate ElectricSQL shape-based Postgres sync patterns to it.
  • Explore transport protocol options and latency benchmarks: Use Explore agent to compare WebTransport, SSE, and WebSocket tradeoffs
  • Implement transactional outbox pattern with CDC pipeline: Use Task agent to set up database triggers, outbox table, and background worker
  • Design real-time architecture for collaborative editing: Use Plan agent to map CRDT strategy, presence management, and conflict resolution flow
  • Build multi-stream AI orchestration component: Use Task agent to implement parallel token stream rendering with backpressure
  • Audit real-time connection lifecycle management: Use Review agent to check for stream leaks, missing cleanup, and reconnection handling

References

  • WebTransport streaming and worker patterns
  • Pub/sub messaging and guaranteed delivery
  • CRDTs and collaborative editing
  • AI stream orchestration patterns
  • Collaborative undo and redo patterns

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.