What problem does it solve?
Writing a cloudSyncModule.ts for Ledger Sync involves subtle invariants around diffing, merging, and schema design; breaking any one of them causes infinite sync loops, silent data loss across a user's devices, or sync failures for unrelated modules. This Skill encodes the contract, the invariants, and the known traps so a module works correctly the first time.
Core Features & Use Cases
- Contract guidance: Explains the three hooks (
diffLocalToDistant, resolveIncrementalUpdate, applyUpdate), their sync/async constraints, and the six invariants (short-circuiting, stability, round-trip, convergence, purity) the sync loop depends on.
- Data-loss risk checklist: Covers the traps that wipe or corrupt user data — persistence lifetime mismatches, strict schemas, discarded
.transform() outputs, forbidden migrations, and payload privacy rules.
- Testing and wiring: Provides the mandatory
describeCloudSyncModuleContract test setup, module-specific test cases that catch what the contract suite misses, and the full registration checklist across walletSyncComposition.ts, both apps' reducers, useWatchWalletSync, and web-tools.
- Use Case: When adding a new entity (e.g., a settings slice) that must sync between Ledger Wallet Desktop and Mobile, use this Skill to author the module, write its tests, and complete every registration site without missing the duplicated schema or the third web-tools registration.
Quick Start
Use the cloud-sync-module skill to write a new cloudSyncModule.ts for my entity and list every file I need to touch to register it.