electric
Installation
SKILL.md
ElectricSQL + TanStack DB
Overview
Use this skill to implement the Electric + TanStack DB stack for local-first apps. Focus on secure proxying, shape configuration, optimistic write flow, and live queries. The full guide is in references/electric-docs.md.
Golden path
- Create a project and run migrations.
- Add an Electric proxy route on the server and inject SOURCE_ID/SECRET.
- Create Electric collections on the client with
electricCollectionOptions. - Implement write handlers that call the API and return a Postgres txid.
- Use live queries for reads and joins.
- Validate performance, auth, and deployment setup.
Security rules (always)
- Never expose SOURCE_SECRET to the browser.
- Do not call Electric directly from production clients.
- Define shapes server-side; do not allow client-defined tables or WHERE clauses.