
Agent Crdt Synchronizer
Synchronize conflict-free replicated state across distributed agents or nodes without central locking.
Overview
Agent CRDT Synchronizer is an agent skill most often used in Build (also Operate, Ship) that implements conflict-free replicated data types for eventually consistent multi-replica state sync.
Install
npx skills add https://github.com/ruvnet/ruflo --skill agent-crdt-synchronizerWhat is this skill?
- State-based and operation-based CRDT implementations with deterministic merge
- Delta synchronization for incremental state updates between replicas
- Conflict-free handling for counters, sets, registers, and composite structures
- Causal consistency ordering for related operations
- Pre/post hooks for sync tasks and convergence validation messaging
- Covers state-based and operation-based CRDT modes
- Handles counters, sets, registers, and composite structures
- Five core responsibility areas including delta sync and causal consistency
Adoption & trust: 637 installs on skills.sh; 58.5k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Distributed agents or services each hold partial state and you need merges that always converge without centralized coordination.
Who is it for?
Indie builders adding shared live state to agent swarms, edge replicas, or collaborative backends.
Skip if: Strong consistency requirements, single-writer SQL workflows, or teams that only need simple HTTP caching.
When should I use this skill?
TASK involves synchronization, CRDT state, or conflict-free replicated updates across nodes.
What do I get? / Deliverables
Replicas exchange deltas and apply deterministic CRDT merges so shared counters, sets, and registers stay consistent under concurrent updates.
- CRDT synchronizer module wiring replicas and merge logic
- Delta sync flow with convergence validation steps
- Documented conflict-free merge behavior per data type
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
CRDT sync is implemented as core backend and integration plumbing while you build multi-agent or distributed features. Eventually consistent counters, sets, registers, and delta sync belong in backend architecture, not UI or launch work.
Where it fits
Wire CRDT counters into an agent mesh so parallel tool calls increment shared budget safely.
Connect replicas over your message bus with delta payloads instead of full state dumps.
Simulate concurrent writes and assert all nodes converge after sync rounds.
Diagnose divergence by replaying operation logs against merge rules.
How it compares
Use for mergeable replicated state instead of ad-hoc last-write-wins JSON patches across nodes.
Common Questions / FAQ
Who is agent-crdt-synchronizer for?
Solo and indie developers building distributed agents, sync-heavy APIs, or multi-device apps who need mathematically defined conflict-free merges.
When should I use agent-crdt-synchronizer?
During build when wiring agent backends; during ship when validating convergence under load; during operate when debugging replica drift—whenever replicas must stay eventually consistent.
Is agent-crdt-synchronizer safe to install?
Review the Security Audits panel on this Prism page and inspect hook scripts and network assumptions in your fork before running in production.
SKILL.md
READMESKILL.md - Agent Crdt Synchronizer
--- name: crdt-synchronizer type: synchronizer color: "#4CAF50" description: Implements Conflict-free Replicated Data Types for eventually consistent state synchronization capabilities: - state_based_crdts - operation_based_crdts - delta_synchronization - conflict_resolution - causal_consistency priority: high hooks: pre: | echo "🔄 CRDT Synchronizer syncing: $TASK" # Initialize CRDT state tracking if [[ "$TASK" == *"synchronization"* ]]; then echo "📊 Preparing delta state computation" fi post: | echo "🎯 CRDT synchronization complete" # Verify eventual consistency echo "✅ Validating conflict-free state convergence" --- # CRDT Synchronizer Implements Conflict-free Replicated Data Types for eventually consistent distributed state synchronization. ## Core Responsibilities 1. **CRDT Implementation**: Deploy state-based and operation-based conflict-free data types 2. **Data Structure Management**: Handle counters, sets, registers, and composite structures 3. **Delta Synchronization**: Implement efficient incremental state updates 4. **Conflict Resolution**: Ensure deterministic conflict-free merge operations 5. **Causal Consistency**: Maintain proper ordering of causally related operations ## Technical Implementation ### Base CRDT Framework ```javascript class CRDTSynchronizer { constructor(nodeId, replicationGroup) { this.nodeId = nodeId; this.replicationGroup = replicationGroup; this.crdtInstances = new Map(); this.vectorClock = new VectorClock(nodeId); this.deltaBuffer = new Map(); this.syncScheduler = new SyncScheduler(); this.causalTracker = new CausalTracker(); } // Register CRDT instance registerCRDT(name, crdtType, initialState = null) { const crdt = this.createCRDTInstance(crdtType, initialState); this.crdtInstances.set(name, crdt); // Subscribe to CRDT changes for delta tracking crdt.onUpdate((delta) => { this.trackDelta(name, delta); }); return crdt; } // Create specific CRDT instance createCRDTInstance(type, initialState) { switch (type) { case 'G_COUNTER': return new GCounter(this.nodeId, this.replicationGroup, initialState); case 'PN_COUNTER': return new PNCounter(this.nodeId, this.replicationGroup, initialState); case 'OR_SET': return new ORSet(this.nodeId, initialState); case 'LWW_REGISTER': return new LWWRegister(this.nodeId, initialState); case 'OR_MAP': return new ORMap(this.nodeId, this.replicationGroup, initialState); case 'RGA': return new RGA(this.nodeId, initialState); default: throw new Error(`Unknown CRDT type: ${type}`); } } // Synchronize with peer nodes async synchronize(peerNodes = null) { const targets = peerNodes || Array.from(this.replicationGroup); for (const peer of targets) { if (peer !== this.nodeId) { await this.synchronizeWithPeer(peer); } } } async synchronizeWithPeer(peerNode) { // Get current state and deltas const localState = this.getCurrentState(); const deltas = this.getDeltasSince(peerNode); // Send sync request const syncRequest = { type: 'CRDT_SYNC_REQUEST', sender: this.nodeId, vectorClock: this.vectorClock.clone(), state: localState, deltas: deltas }; try { const response = await this.sendSyncRequest(peerNode, syncRequest); await this.processSyncResponse(response); } catch (error) { console.error(`Sync failed with ${peerNode}:`, error); } } } ``` ### G-Counter Implementation ```javascript class GCounter { constructor(nodeId, replicationGroup, initialState = null) { this.nodeId = nodeId; this.replicationGroup = replicationGroup; this.payload = new Map();