---
name: "sqlite-libsql-turso-distributed"
description: "Deploy distributed, embedded SQLite replicas worldwide with sub-millisecond edge latency."
metadata:
  author: "Turso Database"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "connect to turso libsql"
  - "configure libsql embedded replica"
  - "sync local edge sqlite replica"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# libSQL & Turso Edge Distributed SQLite

Builds distributed applications with libSQL (Turso): embedded replicas, HRANA websocket protocol, automatic read replication, primary write forwarding, and local SQLite caching on edge servers.

## When to Invoke
Invoke this skill whenever you need to:
- connect to turso libsql
- configure libsql embedded replica
- sync local edge sqlite replica

## Execution SOP & Rules
1. Install @libsql/client or native Python/Go bindings for libSQL.
2. Initialize client with embedded replica: createClient({ url: 'file:local.db', syncUrl: 'libsql://...' }).
3. Call await client.sync() periodically or on background cron to pull latest transactions.
4. Perform fast read queries against local embedded file and let client forward write mutations to primary.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
