ditto-mesh-networking
Skill4 starsChanged 9 days agoMITView on GitHub
Use ONLY for Ditto peer-to-peer networking: choosing BLE, LAN, AWDL, Wi-Fi Aware, WebSocket or TCP transports; diagnosing discovery and connection failures; runtime transport configuration, multihop sync, connection budgets and BLE document sizing. Not Zigbee, Thread, BLE Mesh, router mesh or service mesh. Per-language syntax belongs to the Ditto SDK skill.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- data-modelingSkill
- data-streamsSkill
- kotlin-sdkSkill
- swift-sdkSkill
- sync-subscriptionsSkill
- write-dqlSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Read only the matching reference section.
- Distinctive: line 108
Do not disable radios for battery savings without measurement: removing a fast path can force more traffic over a slower, more expensive …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ditto Mesh Networking and Transports
Ditto peers form a mesh over several transports at once. Each discovers peers and opens physical connections; the multiplexer combines links to the same peer into one virtual connection and selects a path for traffic (the rainbow connection). Presence and multihop routing let peers sync without a direct connection or a server.
For 5.2.0 connection limits, keepalive defaults, wireless fixes and NGN settings, read versions.md. Latest known release: 5.2.0.
Start with the task
Read only the matching reference section. Inspect the contents of a long file before reading a section; do not load every reference or the README as setup.
| Task | Read |
| Diagnose missing peers or no sync | platform-requirements.md §8, then the failing stage in mesh-formation.md §1 |
| Choose radios, compare bandwidth/platforms/failure modes | transports.md, only the candidate transports |
| Cross subnets or bypass blocked mDNS | transports.md §6 |
| Set fields/defaults or change a running config | transport-config.md |
| Understand presence, connection caps, churn or sync groups | mesh-formation.md |
| Configure permissions, entitlements or OS/network prerequisites | platform-requirements.md, target platform only |
| Check a version or SDK-specific behavior | versions.md |
| Budget documents/attachments/subscriptions for transports | best-practices.md |
| Adapt a deployment | deployment-scenarios.md, matching scenario only |
| Configure transport system queries | transport-config.md §7 |
For exact API spelling, use the language's Ditto SDK skill or
https://docs.ditto.live/sdk/latest/sync/customizing-transport-configurations.
For query syntax use write-dql; for subscription propagation use sync-subscriptions;
for schema design use data-modeling. These are separate skills, not prerequisites.
Version awareness
Supports Ditto SDK 4.14.x (LTS), 5.0.x, 5.1.x and 5.2.0. Confirm the SDK when a claim
turns on version or platform: hard document-limit behavior, transport availability and
TRANSPORTS_DISCOVERED_PEERS (4.12.0+) are not universal. Consult the matching row in
references/versions.md; defaults are not a permanent contract.
Choose a transport mix
| Transport | Reach and role | Platform constraint |
| Bluetooth LE | Nearby, infrastructure-free fallback; roughly 20 KB/s effective | Bridges native iOS and Android |
| LAN | Same Wi-Fi/Ethernet network; mDNS discovery + TCP; high bandwidth | Cross-platform; network may block multicast |
| AWDL | Fast nearby Apple-to-Apple sync without an AP | Apple only; check SDK/platform version |
| Wi-Fi Aware | Fast nearby Android-to-Android sync without an AP | Android API 29+; hardware support required |
| WebSocket | Known endpoint, usually Ditto Server; cloud store-and-forward | Only transport for browser/Wasm |
| TCP connect/listen | Known address/port; fixed infrastructure or blocked mDNS | Cross-platform native |
A mixed iOS/Android fleet without infrastructure depends on BLE: AWDL and Wi-Fi Aware do not interoperate. WebSocket does not discover nearby peers. A small-peer-only mesh works without Ditto Server but lacks cloud store-and-forward for peers never co-located. Browser/Wasm rejects P2P settings; on native, unsupported-platform settings may throw or be ignored depending on SDK. Validate platform prerequisites as well as configuration.
Change configuration safely
The core config groups are peerToPeer (radios), connect (outbound endpoints),
listen (inbound listeners) and global (sync group/routing hint).
Read-modify-write the current config. A freshly constructed TransportConfig starts with every transport disabled, unlike the platform defaults: setting only BLE can silently turn off LAN and AWDL.
Runtime updates diff old/new config per transport:
- Enabling starts discovery/connections; disabling drops that transport's connections. Unchanged transports keep their connections. Ordinary changes need no sync restart.
- Added URLs start connection attempts. Removing URLs stops that endpoint only if a managed cloud URL is not being re-added by the SDK.
- Stop sync before changing
syncGroup, then start again. A live change forces an internal restart. Sync groups scope connections; they are not an access-control boundary. - Transport changes preserve local writes. Interrupted transfers resume; a received document stays invisible until complete. Enabling config cannot override OS radio state or a missing permission; inspect transport-condition callbacks.
Size for the required radios
BLE's bandwidth makes many small documents preferable to a few large ones when BLE is required. Documents appear only after complete arrival; 256 KiB takes over 10 seconds at roughly 20 KB/s. Sync sends changed fields, but merge/storage work scales with the whole document. On LAN/cloud-only fleets, embedding related data can remain appropriate.
The default soft warning is 256 KiB, hard limit 5 MiB. Whether oversized local
writes are rejected or only logged is version-dependent; check references/versions.md
before advising. 5.2.0 drops replication diffs that would push the document over its hard limit and stops that document’s updates until
eviction/re-sync; older versions can accept oversized replicated documents. Binary data belongs
in attachments, fetched separately by default. Use data-modeling for split decisions
and best-practices.md for transport budget calculations.
Diagnose reachability over time
Peers intentionally do not all connect to every other peer. Connection budgets rank LAN > P2P Wi-Fi > BLE, with release-dependent counts; churn frees slots for waiting peers and helps prevent isolated islands. Direct edges change by design, so observe reachability over a window. A missing direct connection alone is not a sync failure.
For missing data, locate the failing stage: discovery → connection → presence →
subscription → replication → local query. A relay can forward only data it holds;
see sync-subscriptions or https://docs.ditto.live/key-concepts/syncing-data.
Do not disable radios for battery savings without measurement: removing a fast path can
force more traffic over a slower, more expensive one.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

