sync-registry
SKILL.md
Sync Registry
Name-addressable typed records with optional TTL-backed liveness, CAS updates, and Redis-native prefix queries. Combines the change-streaming of ephemeral with durable key/value semantics.
Decision Guide: registry vs ephemeral
- registry: entries can be static (no TTL) or live (with TTL). Supports
get(),list()with prefix filtering,cas()for optimistic concurrency. Tombstone retention for expired entries. Best for service discovery, config, feature flags. - ephemeral: all entries MUST have TTL. Simpler API, no CAS, no prefix queries. Best for pure presence/session state. See
sync-ephemeralskill.
Typical Pattern: Prefix Snapshot + Stream
list({ prefix: "apps/contacts/" }) → hydrate → reader({ prefix: "apps/contacts/", after: cursor }).stream() → apply events
On overflow, re-list and restart.
Key Design Rules
- Keys use
/as namespace separator. Prefix queries require trailing/(e.g."apps/contacts/"). - Keys must not end with
/, must not contain//, max 8 slash-delimited segments, max 512 bytes. touch()extends TTL without bumpingversion— only for TTL-backed records.cas()comparesentry.versionatomically. Returns{ ok: false }on mismatch or missing entry.- Expired entries become tombstones queryable via
get({ includeExpired: true })orlist({ status: "expired" })fortombstoneRetentionMs(default 5 min).
Gotchas
- Records without
ttlMsinupsert()are static —touch()will return{ ok: false }on them. maxEntriesdefault 10,000. ThrowsRegistryCapacityErrorwhen full (new active keys only).maxPayloadBytesdefault 128KB. ThrowsRegistryPayloadTooLargeError.- Reader scoping:
reader({ key })= exact key,reader({ prefix })= namespace,reader()= whole registry. Each scope has its own Redis stream. stream({ wait: true })auto-retries transient errors. Do not wrap withretry().eventRetentionMsdefault 5 min. Slow consumers getoverflow.
API Reference
Read full API/types/config/defaults in references/api.md.
Weekly Installs
1
Repository
valentinkolb/syncFirst Seen
8 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1