Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

electric-yjs

Skill by electric-sql

Sets up ElectricProvider for real-time collaborative editing with Yjs through Electric shapes. Written for developers adding shared document editing to a Postgres-backed app.

  • Score 90
  • 10k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install electric-yjs

Built from the published package, never by AI.

git clone --depth 1 https://github.com/electric-sql/electric /tmp/electric && mkdir -p ~/.claude/skills && cp -r /tmp/electric/packages/y-electric/skills/electric-yjs ~/.claude/skills/electric-yjs

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install electric-yjs in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

electric-yjs is an agent skill for setting up ElectricProvider, which syncs a Yjs document in real time through Electric shapes. It covers Postgres tables for document updates and awareness, a server endpoint that receives binary Yjs updates, and provider configuration including a BYTEA parser, debounced writes, and resume state for reconnection.

It is for developers adding collaborative editing with Yjs and Electric. The skill builds on the electric-shapes skill, which should be read first for ShapeStream configuration. It also covers connection status events, a sendErrorRetryHandler, and the lifecycle calls connect and disconnect. Common mistakes include skipping resume state, omitting the BYTEA parser, and leaving debounceMs at its default.

Written from the project's SKILL.md and checked against it.

What it can do

  • ElectricProvider setupConfigures a Yjs provider with document updates and awareness shapes.
  • Document updates shapeReads Yjs updates stored as BYTEA using the parseToDecoder parser.
  • Awareness shapeStreams live awareness from offset 'now' without historical backfill.
  • Resume stateUses LocalStorageResumeStateProvider so reconnects send only a stableStateVector diff.
  • Write batchingSets debounceMs to batch rapid edits before they are sent to the server.
  • Postgres schemaDefines ydoc_update and ydoc_awareness tables and a stale awareness cleanup trigger.
  • CORS header exposureShows which Electric headers the proxy must expose to the browser.
  • Connection lifecycleCovers status and sync events plus manual connect and disconnect calls.

What you need

  • Postgres database
  • Yjs (Y.Doc)
  • @electric-sql/y-electric package
  • electric-shapes skill

Try asking

  • Set up an ElectricProvider for a Yjs document in my room.
  • Create the ydoc_update and ydoc_awareness Postgres tables for Yjs sync.
  • Add resume state so my Yjs provider reconnects with a state vector diff.

Good to know

  • Default debounceMs is 0, which sends a PUT request for every edit.
  • Targets @electric-sql/y-electric v0.1.x.
  • Read the electric-shapes skill first for ShapeStream configuration.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: packages/y-electric/skills/electric-yjs/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md7 KB

Alternatives to electric-yjs

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

electric-yjs: common questions

Why does the Yjs shape need a BYTEA parser?

Yjs updates are stored as BYTEA in Postgres. The skill says that without parseToDecoder the shape returns raw hex strings and Y.applyUpdate can fail or corrupt the document.

What does resume state do in electric-yjs?

When stableStateVector is provided in resume state, the provider sends only the diff between the stored vector and the current document on reconnect. Without it, the full document shape is fetched.

Which Postgres tables does electric-yjs need?

It needs a ydoc_update table for document updates and a ydoc_awareness table for awareness, with a trigger that removes stale awareness entries after 30 seconds.

How do I install electric-yjs?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is electric-yjs free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is electric-yjs safe to use?

It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to electric-yjs?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

electric-yjs Install

Add to stack

Loading.