implementing-realtime-sync

implementing-realtime-sync is a skill for Claude Code from ancoleman/ai-design-components. It costs 104 tokens per session (2,200 once invoked), scanned A, original, MIT.

A guide for adding live communication between software and its users or between multiple users. It covers options such as server-sent events for one-way updates, WebSockets for two-way communication, and WebRTC for direct peer connections.

In plain words
What is it for?
Use it for chat, live dashboards, streaming responses, shared documents, multiplayer features, presence indicators, and offline-first apps.
Why use it?
It helps choose how updates should travel and handle concerns such as reconnection, streaming, collaboration, and offline changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the backend-api-skills plugin — 3 skills shipped together

Good fit Use it for chat, live dashboards, streaming responses, shared documents, multiplayer features, presence indicators, and offline-first apps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ancoleman/ai-design-components/implementing-realtime-sync
Install

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.

Any agent
npx skills add ancoleman/ai-design-components --skill implementing-realtime-sync
Clone the repo
git clone --depth 1 https://github.com/ancoleman/ai-design-components

Made for: Claude Code.

Or install backend-api-skills, the plugin that ships this one along with the rest of its 3 skills.

Wrote 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.

agentmods badge for implementing-realtime-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/ancoleman/ai-design-components/implementing-realtime-sync/github.svg)](https://agentmods.dev/skills/ancoleman/ai-design-components/implementing-realtime-sync)
Your own site
<a href="https://agentmods.dev/skills/ancoleman/ai-design-components/implementing-realtime-sync"><img src="https://agentmods.dev/badge/skills/ancoleman/ai-design-components/implementing-realtime-sync/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.

agentmods 80×15 button for implementing-realtime-sync

Your own site · 80×15
<a href="https://agentmods.dev/skills/ancoleman/ai-design-components/implementing-realtime-sync"><img src="https://agentmods.dev/badge/skills/ancoleman/ai-design-components/implementing-realtime-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,200 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00104 $0.02200
Opus 5.5 $0.00042 $0.00880
Sonnet 5.5 $0.00021 $0.00440
Haiku 4.5 $0.00010 $0.00220

Measured 2mo ago against content hash 812c6ddc4738, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

implementing-realtime-sync 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 2mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (examples/llm-streaming-sse/backend.py, scripts/test_websocket_connection.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/implementing-realtime-sync/SKILL.md · 293 lines

How it starts

The opening of the file, as written. The whole thing — 293 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Real-Time Sync

Implement real-time communication for live updates, collaboration, and presence awareness across applications.

When to Use

Use this skill when building:

  • LLM streaming interfaces - Stream tokens progressively (ai-chat integration)
  • Live dashboards - Push metrics and updates to clients
  • Collaborative editing - Multi-user document/spreadsheet editing with CRDTs
  • Chat applications - Real-time messaging with presence
  • Multiplayer features - Cursor tracking, live updates, presence awareness
  • Offline-first apps - Mobile/PWA with sync-on-reconnect

Protocol Selection Framework

Choose the transport protocol based on communication pattern:

Decision Tree

ONE-WAY (Server → Client only)
├─ LLM streaming, notifications, live feeds
└─ Use SSE (Server-Sent Events)
   ├─ Automatic reconnection (browser-native)
   ├─ Event IDs for resumption
   └─ Simple HTTP implementation

BIDIRECTIONAL (Client ↔ Server)
├─ Chat, games, collaborative editing
└─ Use WebSocket
   ├─ Manual reconnection required
   ├─ Binary + text support
   └─ Lower latency for two-way

COLLABORATIVE EDITING
├─ Multi-user documents/spreadsheets
└─ Use WebSocket + CRDT (Yjs or Automerge)
   ├─ CRDT handles conflict resolution
   ├─ WebSocket for transport
   └─ Offline-first with sync

PEER-TO-PEER MEDIA
├─ Video, screen sharing, voice calls
└─ Use WebRTC
   ├─ WebSocket for signaling
   ├─ Direct P2P connection
   └─ STUN/TURN for NAT traversal

Protocol Comparison

Protocol Direction Reconnection Complexity Best For
SSE Server → Client Automatic Low Live feeds, LLM streaming
WebSocket Bidirectional Manual Medium Chat, games, collaboration
WebRTC P2P Complex High Video, screen share, voice

Implementation Patterns

Pattern 1: LLM Streaming with SSE

Stream LLM tokens progressively to frontend (ai-chat integration).

Python (FastAPI):

from sse_starlette.sse import EventSourceResponse

@app.post("/chat/stream")
async def stream_chat(prompt: str):
    async def generate():
        async for chunk in llm_stream:
            yield {"event": "token", "data": chunk.content}
        yield {"event": "done", "data": "[DONE]"}
    return EventSourceResponse(generate())

Read the full file on GitHub · 293 lines

Changes

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.

  1. 2mo ago First seen · 293 lines · 104 tokens per session scan A 812c6ddc4738

Subscribe to this mod's changes

implementing-realtime-sync is a skill published in the GitHub repository ancoleman/ai-design-components (526 stars, last pushed 10mo ago), licensed MIT. It adds 104 tokens to every session and 2,200 once invoked, about $0.0004 per session on Opus 5.5. 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-08-30.

Related

Other skills, from other repositories

form-strategy

Design forms that convert, validate well, resist spam, and integrate cleanly with downstream systems. Use this skill when designing or auditing any form (contact, signup, checkout, multi-step, embedded), planning validation logic, fighting spam, choosing form tooling, or improving form conversion. Triggers on form…

rampstackco/claude-skills · 107 tokens

mcp-server-builder

Use to build, wire up, or debug an MCP (Model Context Protocol) server that gives Claude access to an internal API, database, or SaaS tool. Trigger when the user wants Claude to connect to their own system, asks for an MCP server, needs custom tools for Claude Code or the Claude app, or an existing server's tools are…

OneWave-AI/claude-skills · 79 tokens

api-endpoint-scaffolder

Generate REST API endpoints with proper structure, validation, error handling, and types. Use when creating new API routes, endpoints, or backend services.

OneWave-AI/claude-skills · 36 tokens

netlify-development

Best practices for building and deploying Netlify sites, covering serverless and edge functions, Netlify Blobs storage, the Image CDN, and build configuration. Use when writing Netlify Functions or Edge Functions, configuring netlify.toml or redirects/headers, managing environment variables across deploy contexts…

Mindrally/skills · 78 tokens

api-security-best-practices

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities.

lingxling/awesome-skills-cn · 29 tokens

apollo-graphql

Guidelines for developing GraphQL APIs and React applications using Apollo Client for state management, data fetching, and caching.

Mindrally/skills · 26 tokens