[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C57V1EZKA9B5W1G4F00HAH":3,"skill-same:01M6C57V1EZKA9B5W1G4F00HAH":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":14,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6C57V1EZKA9B5W1G4F00HAH","guide",null,"Searches the complete Ditto SDK best practices guide (SDK 5.2.0, Flutter, JavaScript, Kotlin, Swift) bundled with this plugin, for answers the focused ditto skills do not cover. Use to look up a Ditto API, DQL keyword or function, system parameter, error message, an SDK's API or behavior, or the reasoning behind a rule, or when a Ditto question spans several topics.","ditto-examples\u002Fditto-cookbook","ditto-examples","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192611150?v=4","01M6C57F0Y1W6S5D9RD8GHE3YB","Ditto Examples","01M6C57F52Z11DDMBC0ZJ7FJPG",0,"MIT","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fguide\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"do","topics","javascript","when","flutter","kotlin","ditto","for","complete","message","error","with","api","best practices","use","question","up","system","plugin","2026-11-10 10:12:30",false,"---\nname: guide\ndescription: \"Searches the complete Ditto SDK best practices guide (SDK 5.2.0, Flutter, JavaScript, Kotlin, Swift) bundled with this plugin, for answers the focused ditto skills do not cover. Use to look up a Ditto API, DQL keyword or function, system parameter, error message, an SDK's API or behavior, or the reasoning behind a rule, or when a Ditto question spans several topics.\"\n---\n\n# Ditto Best Practices Guide\n\nThe full guide (SDK 5.2.0) is in two directories: [reference\u002Fbest-practices\u002F](reference\u002Fbest-practices\u002FREADME.md), what to do and what to avoid, one page per topic that applies to every SDK, plus one page per SDK in `reference\u002Fbest-practices\u002Fplatforms\u002F` with that SDK's API calls, code, and behavior; and [reference\u002Fknowledge\u002F](reference\u002Fknowledge\u002FREADME.md), how Ditto works, the reference material (CRDT merge rules, DQL functions, system collections and parameters, platform differences, SDK releases, glossary), and, in `reference\u002Fknowledge\u002Fobservations\u002F`, the observations from our testing with their numbers, including one page per SDK for what only that SDK does. Do not read them whole: search them and read only the sections you need. The focused skills (`query-sync`, `data-modeling`, `storage-lifecycle`, `transactions-attachments`, `performance-observability`, `sdk-setup`, `testing`, `audit`) summarize the guide; use this skill for details they leave out.\n\n## How to Search\n\nSearch `reference\u002Fbest-practices\u002F` and `reference\u002Fknowledge\u002F` by name, one search each (or both as paths). Do not search `reference\u002F` itself: inside the Ditto Cookbook repository the two directories are symbolic links, which a search of their parent does not enter. If `reference\u002Fbest-practices\u002FREADME.md` does not exist, the guide was not installed with the plugin (for example, a checkout without symbolic links): say so, and answer from the focused skills and [docs.ditto.live](https:\u002F\u002Fdocs.ditto.live).\n\n1. **Exact terms first.** Grep both directories for the exact API name (`registerObserverV2`), DQL keyword (`UPDATE_LOCAL_DIFF`), system parameter (`TOMBSTONE_TTL_HOURS`), or error text (`disallowed without appropriate index support`). Use `-n` and read about 40-150 lines around the best hit.\n2. **Sections by heading.** A `§ \u003CHeading>` citation in another skill is a heading in one of the pages, and every heading is unique across the guide: Grep the heading text as a fixed string (`grep -rnF`, or Grep with the regex characters `( ) + .` escaped), because many headings contain `(SDK 5.1+)`. To see the outline of a page, Grep `^#{1,3} ` in it with line numbers.\n3. **Version-specific behavior.** Grep `Note \\(SDK` for every caveat: **Note (SDK 5.1.0 and 5.2.0)** was confirmed on both releases, **Note (SDK 5.1.0)** describes 5.1.0 behavior that 5.2.0 no longer shows (the note says what 5.2.0 does), and **Note (SDK 5.2.0)** was observed on 5.2.0 (the note or its observation entry says whether 5.1.0 differed or was not tested). Issues that only 5.1.0 has (fixed in 5.2.0) are listed under `§ Known Issues in SDK 5.1.0`; read it whenever a device runs 5.1.0. Grep `\\(SDK 5.1\\+\\)` and `\\(SDK 5.2\\+\\)` for APIs added in 5.1 and 5.2, and `Experimental|Beta` for unstable APIs. If the project uses another SDK version, treat these as items to verify, not facts.\n4. **Read whole subsections.** Each section is written to be read on its own and ends with ✅ DO \u002F ❌ DON'T lists and `✅ GOOD` \u002F `❌ BAD` examples; read to the next heading of the same level before answering.\n5. **Code for one SDK.** The topic pages show DQL with its arguments as an `-- Arguments:` JSON comment and link to the SDK pages for code. The SDK pages share their section names, `\u003CTopic> in \u003CSDK>` (Grep `^#+ .* in Swift` for the Swift outline), and end with *Behavior Specific to the \u003CSDK> SDK*.\n\n## Where Things Are\n\nBest practices, in `reference\u002Fbest-practices\u002F`:\n\n| Page | Covers |\n|---|---|\n| `README.md` | How to use the guide (audience, conventions such as (SDK 5.1+)\u002F(SDK 5.2+), Experimental\u002FBeta, and the Note (SDK ...) labels, how the content was verified), the ten essential rules, the disclaimer |\n| `setup-and-lifecycle.md` | Requirements, DittoConfig, one shared instance, startup order, authentication, switching users, system parameters (in `DittoConfig`, `ALTER SYSTEM`), sync start\u002Fstop, shutdown, transports, presence and recording it in documents |\n| `dql.md` | Where queries run, parameters and literals, MISSING vs NULL, query results, error messages and empty results (a lookup table); SELECT (projections, DISTINCT, aggregates, GROUP BY, ORDER BY, LIMIT, USE IDS, membership, JOIN); INSERT and ON ID CONFLICT, UPDATE, RETURNING, DELETE and EVICT |\n| `data-modeling.md` | Strict mode, arrays vs maps, document structure and size, relationships, IDs, counters, checks and claims across devices (locks, uniqueness, sequence numbers, invariants), event history, INITIAL documents, schema evolution, timestamps |\n| `sync-and-subscriptions.md` | Subscription rules and lifecycle, scope balancing, sync scopes, monitoring sync status, a lookup of causes when data does not sync |\n| `observers.md` | The observer APIs of each SDK, when observers fire (by query shape), observer lifecycle, writing from observers on several devices, backpressure and choosing an observer API, diffing, partial UI updates |\n| `transactions.md` | `store.transaction` in each SDK, rules, concurrency, sync |\n| `attachments.md` | Architecture, creating, fetching, immutability, thumbnails, availability, size |\n| `deletion-and-storage.md` | DELETE and tombstones, soft delete, EVICT, choosing a strategy, monitoring storage |\n| `indexing-and-performance.md` | Creating indexes, index usage rules, ADVISE, EXPLAIN and PROFILE, query scope |\n| `logging-and-observability.md` | Logging, support bundles, remote diagnostics |\n| `security.md` | Authentication in production, small-peers-only keys, permissions, revocation, incoming connections, data at rest (encryption on Swift and Kotlin), webhooks, security checklist |\n| `testing.md` | What a local-store test helper does; merge, deletion, observer, subscription, and DQL tests as statements and expected results; multi-peer tests |\n| `anti-patterns.md` | Questions to ask of every collection (assumptions that fail across devices), then a severity-ranked review list (Critical, High, Medium), with a list per SDK |\n| `quick-reference.md` | Condensed DO list, where to look when something goes wrong, common DQL shapes and the SDK sections with code |\n| `platforms\u002Fflutter.md`, `platforms\u002Fjavascript.md`, `platforms\u002Fkotlin.md`, `platforms\u002Fswift.md` | One page per SDK, with the same sections: installing, opening and `DittoConfig`, one shared instance, app startup, authentication, switching users, sync and the app lifecycle, closing, executing DQL, argument and value types, query results, subscriptions, store observers (lifecycle, backpressure, diffing, partial UI updates), transactions, attachments, IDs and timestamps, transports and presence, logging, testing, and the behavior specific to the SDK |\n\nKnowledge, in `reference\u002Fknowledge\u002F`:\n\n| Page | Covers |\n|---|---|\n| `understanding-ditto.md` | What Ditto is, key characteristics, core principles |\n| `crdt-types.md` | CRDT types, how values are typed, merge semantics, what concurrent edits produce, rewriting an unchanged value, what syncs after offline edits, reordering on two devices, conditions across devices, local write semantics, choosing a type |\n| `dql-functions.md` | Date and time, conditional, type checking, string, object, array, ANY\u002FEVERY, conversion functions |\n| `system-reference.md` | System virtual collections, system parameters reference |\n| `platform-differences.md` | The APIs and the behavior of Flutter, JavaScript, Kotlin, and Swift side by side, with links to the SDK pages |\n| `upgrading.md` | Changes in SDK 5.2.0, known issues of 5.1.0 that 5.2.0 fixed (for devices that still run 5.1.0), mixed releases, rolling back |\n| `glossary.md`, `references.md` | Terms and external documentation links |\n\nObservations from our testing, in `reference\u002Fknowledge\u002Fobservations\u002F`, one entry per observation with the SDK releases, the setup, every number, and what was not tested. Read them for the evidence behind a rule, or when a question is about how Ditto behaved:\n\n| Page | Covers |\n|---|---|\n| `observations\u002Fhow-we-tested.md` | The test environment and its limits, how to read the results, the checks of the guide |\n| `observations\u002Fsubscriptions-and-replication.md` | What subscriptions deliver and what registering them costs, relays, the initial sync, order and atomicity, sync traffic, stopping and closing, the list of subscriptions, sync status |\n| `observations\u002Fconnections-and-presence.md` | The TCP connection limit, meshes, WebSocket hubs, retries, detecting lost connections, presence, presence written to documents, peer metadata, accepting connections, shared keys |\n| `observations\u002Fmerge-behavior.md` | Concurrent edits, also between SDK releases, conditional updates, read-modify-write, reordering, renaming, counters |\n| `observations\u002Fclocks-and-time.md` | Device clocks and last-writer-wins, how a wrong clock spreads, `clock()` in subscriptions and observers |\n| `observations\u002Fstorage-and-deletion.md` | Soft delete, tombstones and reaping, eviction, disk space, the write-ahead log, deleted data on disk |\n| `observations\u002Fdocuments-and-limits.md` | The hard size limit across devices and releases, document weight, nesting depth |\n| `observations\u002Fpersistence-directory.md` | Copies of a directory, Database IDs, deleting parts of a directory, locks |\n| `observations\u002Fdql-behavior.md` | Statements that held, writes and arguments, `USE IDS`, comparison and ordering, IDs and field names, indexes and query plans (SDK 5.1.0 issues, migration), long conditions and `ANY`, SDK 5.0.3 differences |\n| `observations\u002Fperformance-measurements.md` | Statements and write rates, many fields and collections, queries and indexes, memory, hub load |\n| `observations\u002Ftransaction-behavior.md` | Concurrency and reads, long transactions, deadlocked transactions |\n| `observations\u002Fobserver-behavior.md` | When observers fire, batching of changes, observers that write on several devices, observers of `system:` collections, release differences |\n| `observations\u002Fattachment-behavior.md` | Relaying and fetching attachments, slow links, garbage collection of blobs |\n| `observations\u002Fflutter-sdk.md`, `observations\u002Fjavascript-sdk.md`, `observations\u002Fkotlin-sdk.md`, `observations\u002Fswift-sdk.md` | What one SDK's API does: opening and shutting down, errors, login, callbacks and handles, values of the language, calls after shutdown, transactions and their threads, logging |\n| `observations\u002Fconfiguration-and-diagnostics.md` | Parameter defaults, environment variables, the offline license token, request diagnostics, logs |\n\n## Answering\n\n- Quote or paraphrase the guide precisely; keep its qualifiers (\"in our testing\", \"SDK 5.1.0\", \"according to the 5.2.0 release notes\", \"Experimental\"). Statements marked \"in our testing\" are behavior observed on the releases the statement names (Ditto's own behavior mostly with JavaScript SDK peers on one machine, and each SDK's API with that SDK), not documented guarantees; the observation pages give the setup and the numbers.\n- Cite the section you used as `§ \u003CHeading>` so the user can find it.\n- If the guide does not cover the question, say so, and point to Ditto's documentation (https:\u002F\u002Fdocs.ditto.live) instead of guessing.\n- Answer with the code of the project's SDK: the matching section of `reference\u002Fbest-practices\u002Fplatforms\u002F\u003Csdk>.md`. Do not translate one SDK's code to another; where the SDKs differ, the topic pages say so, and `§ Platform Differences` compares them.\n","# Ditto Best Practices Guide\n\nThe full guide (SDK 5.2.0) is in two directories: [reference\u002Fbest-practices\u002F](reference\u002Fbest-practices\u002FREADME.md), what to do and what to avoid, one page per topic that applies to every SDK, plus one page per SDK in `reference\u002Fbest-practices\u002Fplatforms\u002F` with that SDK's API calls, code, and behavior; and [reference\u002Fknowledge\u002F](reference\u002Fknowledge\u002FREADME.md), how Ditto works, the reference material (CRDT merge rules, DQL functions, system collections and parameters, platform differences, SDK releases, glossary), and, in `reference\u002Fknowledge\u002Fobservations\u002F`, the observations from our testing with their numbers, including one page per SDK for what only that SDK does. Do not read them whole: search them and read only the sections you need. The focused skills (`query-sync`, `data-modeling`, `storage-lifecycle`, `transactions-attachments`, `performance-observability`, `sdk-setup`, `testing`, `audit`) summarize the guide; use this skill for details they leave out.\n\n## How to Search\n\nSearch `reference\u002Fbest-practices\u002F` and `reference\u002Fknowledge\u002F` by name, one search each (or both as paths). Do not search `reference\u002F` itself: inside the Ditto Cookbook repository the two directories are symbolic links, which a search of their parent does not enter. If `reference\u002Fbest-practices\u002FREADME.md` does not exist, the guide was not installed with the plugin (for example, a checkout without symbolic links): say so, and answer from the focused skills and [docs.ditto.live](https:\u002F\u002Fdocs.ditto.live).\n\n1. **Exact terms first.** Grep both directories for the exact API name (`registerObserverV2`), DQL keyword (`UPDATE_LOCAL_DIFF`), system parameter (`TOMBSTONE_TTL_HOURS`), or error text (`disallowed without appropriate index support`). Use `-n` and read about 40-150 lines around the best hit.\n2. **Sections by heading.** A `§ \u003CHeading>` citation in another skill is a heading in one of the pages, and every heading is unique across the guide: Grep the heading text as a fixed string (`grep -rnF`, or Grep with the regex characters `( ) + .` escaped), because many headings contain `(SDK 5.1+)`. To see the outline of a page, Grep `^#{1,3} ` in it with line numbers.\n3. **Version-specific behavior.** Grep `Note \\(SDK` for every caveat: **Note (SDK 5.1.0 and 5.2.0)** was confirmed on both releases, **Note (SDK 5.1.0)** describes 5.1.0 behavior that 5.2.0 no longer shows (the note says what 5.2.0 does), and **Note (SDK 5.2.0)** was observed on 5.2.0 (the note or its observation entry says whether 5.1.0 differed or was not tested). Issues that only 5.1.0 has (fixed in 5.2.0) are listed under `§ Known Issues in SDK 5.1.0`; read it whenever a device runs 5.1.0. Grep `\\(SDK 5.1\\+\\)` and `\\(SDK 5.2\\+\\)` for APIs added in 5.1 and 5.2, and `Experimental|Beta` for unstable APIs. If the project uses another SDK version, treat these as items to verify, not facts.\n4. **Read whole subsections.** Each section is written to be read on its own and ends with ✅ DO \u002F ❌ DON'T lists and `✅ GOOD` \u002F `❌ BAD` examples; read to the next heading of the same level before answering.\n5. **Code for one SDK.** The topic pages show DQL with its arguments as an `-- Arguments:` JSON comment and link to the SDK pages for code. The SDK pages share their section names, `\u003CTopic> in \u003CSDK>` (Grep `^#+ .* in Swift` for the Swift outline), and end with *Behavior Specific to the \u003CSDK> SDK*.\n\n## Where Things Are\n\nBest practices, in `reference\u002Fbest-practices\u002F`:\n\n| Page | Covers |\n|---|---|\n| `README.md` | How to use the guide (audience, conventions such as (SDK 5.1+)\u002F(SDK 5.2+), Experimental\u002FBeta, and the Note (SDK ...) labels, how the content was verified), the ten essential rules, the disclaimer |\n| `setup-and-lifecycle.md` | Requirements, DittoConfig, one shared instance, startup order, authentication, switching users, system parameters (in `DittoConfig`, `ALTER SYSTEM`), sync start\u002Fstop, shutdown, transports, presence and recording it in documents |\n| `dql.md` | Where queries run, parameters and literals, MISSING vs NULL, query results, error messages and empty results (a lookup table); SELECT (projections, DISTINCT, aggregates, GROUP BY, ORDER BY, LIMIT, USE IDS, membership, JOIN); INSERT and ON ID CONFLICT, UPDATE, RETURNING, DELETE and EVICT |\n| `data-modeling.md` | Strict mode, arrays vs maps, document structure and size, relationships, IDs, counters, checks and claims across devices (locks, uniqueness, sequence numbers, invariants), event history, INITIAL documents, schema evolution, timestamps |\n| `sync-and-subscriptions.md` | Subscription rules and lifecycle, scope balancing, sync scopes, monitoring sync status, a lookup of causes when data does not sync |\n| `observers.md` | The observer APIs of each SDK, when observers fire (by query shape), observer lifecycle, writing from observers on several devices, backpressure and choosing an observer API, diffing, partial UI updates |\n| `transactions.md` | `store.transaction` in each SDK, rules, concurrency, sync |\n| `attachments.md` | Architecture, creating, fetching, immutability, thumbnails, availability, size |\n| `deletion-and-storage.md` | DELETE and tombstones, soft delete, EVICT, choosing a strategy, monitoring storage |\n| `indexing-and-performance.md` | Creating indexes, index usage rules, ADVISE, EXPLAIN and PROFILE, query scope |\n| `logging-and-observability.md` | Logging, support bundles, remote diagnostics |\n| `security.md` | Authentication in production, small-peers-only keys, permissions, revocation, incoming connections, data at rest (encryption on Swift and Kotlin), webhooks, security checklist |\n| `testing.md` | What a local-store test helper does; merge, deletion, observer, subscription, and DQL tests as statements and expected results; multi-peer tests |\n| `anti-patterns.md` | Questions to ask of every collection (assumptions that fail across devices), then a severity-ranked review list (Critical, High, Medium), with a list per SDK |\n| `quick-reference.md` | Condensed DO list, where to look when something goes wrong, common DQL shapes and the SDK sections with code |\n| `platforms\u002Fflutter.md`, `platforms\u002Fjavascript.md`, `platforms\u002Fkotlin.md`, `platforms\u002Fswift.md` | One page per SDK, with the same sections: installing, opening and `DittoConfig`, one shared instance, app startup, authentication, switching users, sync and the app lifecycle, closing, executing DQL, argument and value types, query results, subscriptions, store observers (lifecycle, backpressure, diffing, partial UI updates), transactions, attachments, IDs and timestamps, transports and presence, logging, testing, and the behavior specific to the SDK |\n\nKnowledge, in `reference\u002Fknowledge\u002F`:\n\n| Page | Covers |\n|---|---|\n| `understanding-ditto.md` | What Ditto is, key characteristics, core principles |\n| `crdt-types.md` | CRDT types, how values are typed, merge semantics, what concurrent edits produce, rewriting an unchanged value, what syncs after offline edits, reordering on two devices, conditions across devices, local write semantics, choosing a type |\n| `dql-functions.md` | Date and time, conditional, type checking, string, object, array, ANY\u002FEVERY, conversion functions |\n| `system-reference.md` | System virtual collections, system parameters reference |\n| `platform-differences.md` | The APIs and the behavior of Flutter, JavaScript, Kotlin, and Swift side by side, with links to the SDK pages |\n| `upgrading.md` | Changes in SDK 5.2.0, known issues of 5.1.0 that 5.2.0 fixed (for devices that still run 5.1.0), mixed releases, rolling back |\n| `glossary.md`, `references.md` | Terms and external documentation links |\n\nObservations from our testing, in `reference\u002Fknowledge\u002Fobservations\u002F`, one entry per observation with the SDK releases, the setup, every number, and what was not tested. Read them for the evidence behind a rule, or when a question is about how Ditto behaved:\n\n| Page | Covers |\n|---|---|\n| `observations\u002Fhow-we-tested.md` | The test environment and its limits, how to read the results, the checks of the guide |\n| `observations\u002Fsubscriptions-and-replication.md` | What subscriptions deliver and what registering them costs, relays, the initial sync, order and atomicity, sync traffic, stopping and closing, the list of subscriptions, sync status |\n| `observations\u002Fconnections-and-presence.md` | The TCP connection limit, meshes, WebSocket hubs, retries, detecting lost connections, presence, presence written to documents, peer metadata, accepting connections, shared keys |\n| `observations\u002Fmerge-behavior.md` | Concurrent edits, also between SDK releases, conditional updates, read-modify-write, reordering, renaming, counters |\n| `observations\u002Fclocks-and-time.md` | Device clocks and last-writer-wins, how a wrong clock spreads, `clock()` in subscriptions and observers |\n| `observations\u002Fstorage-and-deletion.md` | Soft delete, tombstones and reaping, eviction, disk space, the write-ahead log, deleted data on disk |\n| `observations\u002Fdocuments-and-limits.md` | The hard size limit across devices and releases, document weight, nesting depth |\n| `observations\u002Fpersistence-directory.md` | Copies of a directory, Database IDs, deleting parts of a directory, locks |\n| `observations\u002Fdql-behavior.md` | Statements that held, writes and arguments, `USE IDS`, comparison and ordering, IDs and field names, indexes and query plans (SDK 5.1.0 issues, migration), long conditions and `ANY`, SDK 5.0.3 differences |\n| `observations\u002Fperformance-measurements.md` | Statements and write rates, many fields and collections, queries and indexes, memory, hub load |\n| `observations\u002Ftransaction-behavior.md` | Concurrency and reads, long transactions, deadlocked transactions |\n| `observations\u002Fobserver-behavior.md` | When observers fire, batching of changes, observers that write on several devices, observers of `system:` collections, release differences |\n| `observations\u002Fattachment-behavior.md` | Relaying and fetching attachments, slow links, garbage collection of blobs |\n| `observations\u002Fflutter-sdk.md`, `observations\u002Fjavascript-sdk.md`, `observations\u002Fkotlin-sdk.md`, `observations\u002Fswift-sdk.md` | What one SDK's API does: opening and shutting down, errors, login, callbacks and handles, values of the language, calls after shutdown, transactions and their threads, logging |\n| `observations\u002Fconfiguration-and-diagnostics.md` | Parameter defaults, environment variables, the offline license token, request diagnostics, logs |\n\n## Answering\n\n- Quote or paraphrase the guide precisely; keep its qualifiers (\"in our testing\", \"SDK 5.1.0\", \"according to the 5.2.0 release notes\", \"Experimental\"). Statements marked \"in our testing\" are behavior observed on the releases the statement names (Ditto's own behavior mostly with JavaScript SDK peers on one machine, and each SDK's API with that SDK), not documented guarantees; the observation pages give the setup and the numbers.\n- Cite the section you used as `§ \u003CHeading>` so the user can find it.\n- If the guide does not cover the question, say so, and point to Ditto's documentation (https:\u002F\u002Fdocs.ditto.live) instead of guessing.\n- Answer with the code of the project's SDK: the matching section of `reference\u002Fbest-practices\u002Fplatforms\u002F\u003Csdk>.md`. Do not translate one SDK's code to another; where the SDKs differ, the topic pages say so, and `§ Platform Differences` compares them.\n",{"name":5,"description":7},"main","b67d1a0bc891c9b2a952f8beb0a6dce7d449717c","plugins\u002Fditto\u002Fskills\u002Fguide","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook","https:\u002F\u002Fdocs.ditto.live\u002Fhome\u002Fintroduction","https:\u002F\u002Fgithub.com\u002Fditto-examples","https:\u002F\u002Fdocs.ditto.live","Example Apps and Information for Ditto","2026-11-13 17:08:48",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add ditto-examples\u002Fditto-cookbook --skill guide",{"tool":58,"command":59},"bunx","bunx skills add ditto-examples\u002Fditto-cookbook --skill guide",{"tool":61,"command":62},"pnpm","pnpm dlx skills add ditto-examples\u002Fditto-cookbook --skill guide","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fguide\u002FSKILL.md",true,[66,72],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"reference\u002Fbest-practices","OTHER","其他",29,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fguide\u002Freference\u002Fbest-practices",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"reference\u002Fknowledge",24,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fguide\u002Freference\u002Fknowledge",[77,87,115,133,142,151],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":38},"01M6C58EAD92WQKNE74549PXEW","transactions-attachments","Ditto SDK transactions and attachments (Flutter, JavaScript, Kotlin, Swift): ditto.store.transaction with tx.execute only, no nesting, short scopes, rollback, close(); newAttachment, ATTACHMENT declarations, lazy fetchAttachment with a stall timeout, immutability, thumbnails, and blob availability. Use when writing or reviewing ditto.store.transaction, newAttachment, or fetchAttachment code, or when displaying photos or files stored in Ditto.","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Ftransactions-attachments\u002FSKILL.md",[],[84,85,86],"transactions attachments","attachments","transactions",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":98,"publishedAt":38},"01M6C58B0PQHV5WXMQRP9DEPX1","testing","Ditto SDK testing strategies in Flutter, JavaScript, Kotlin, or Swift: local-store test helper, tests for DQL statements, MISSING\u002FNULL filters, merge-sensitive writes, soft delete, observer lifecycle, subscription rules, and multi-peer sync tests in one process. Use when writing or reviewing tests for code that uses Ditto, setting up a Ditto test harness, or reproducing a Ditto sync or merge bug.","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Ftesting\u002FSKILL.md",[93],{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[89,99,35,100,101,102,103,104,105,106,107,108,109,110,22,111,112,26,113,114],"writing","filters","code","delete","merge","sync","local","strategies","bug","missing","tests","testing strategies","test harness","swift","harness","lifecycle",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":38},"01M6C587HJC1SVAPYEZHJBV1C7","storage-lifecycle","Ditto SDK data removal and local storage management covering DELETE vs soft delete vs EVICT, tombstones and their TTL, husk documents, eviction with complementary subscriptions, retention cleanup, and storage monitoring. Use when writing Ditto DELETE or EVICT statements, soft-delete flags or retention cleanup for Ditto documents, or TOMBSTONE_TTL_HOURS, or when deleted Ditto data came back or evicted documents sync back.","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fstorage-lifecycle\u002FSKILL.md",[],[114,122,123,105,104,124,99,33,125,126,127,128,129,130,30,131,22,132,25,102],"storage","storage lifecycle","cleanup","documents","monitoring","back","evict","retention","sdk","subscriptions","ttl",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":38},"01M6C5845MAD3AEBNSN3BT61WH","sdk-setup","Ditto SDK setup, lifecycle, and production security (Flutter, JavaScript, Kotlin, Swift): DittoConfig, the authentication expiration handler, system parameters, sync start and stop, close, transports, presence, keys, permissions, revocation. Use when initializing Ditto, writing Ditto login, startup, shutdown, or background code, configuring Ditto transports, reviewing Ditto security, or when Ditto sync never starts or devices do not connect.","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fsdk-setup\u002FSKILL.md",[],[140,141,130],"setup","sdk setup",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":38},"01M6C580SCSJK0E5Z54AJTV242","query-sync","Ditto SDK DQL reads and writes, subscriptions, and store observers (Flutter, JavaScript, Kotlin, Swift): query parameters, MISSING vs NULL, membership filters, subscription and observer lifecycle, ON ID CONFLICT upserts, JOIN, RETURNING. Use when writing or reviewing ditto.store.execute, ditto.sync.registerSubscription, registerObserver, or DQL in an app that uses Ditto, or when Ditto data does not sync or a Ditto query returns nothing.","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002FSKILL.md",[],[104,149,150],"query sync","query",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":38},"01M6C57X4C3TQSWZJC882ECQV2","performance-observability","Ditto SDK store observer performance and diagnostics (Flutter, JavaScript, Kotlin, Swift): observer lifecycle, backpressure (registerObserverV2, signalNext, suspending handlers), narrow UI updates, differs, redundant writes, indexes, ADVISE, EXPLAIN, PROFILE, logging, and system: collections. Use when a Ditto query is slow, a screen showing Ditto data janks, Ditto observers grow memory, Ditto upserts repeat, or when setting up Ditto logging.","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fperformance-observability\u002FSKILL.md",[],[158,159,160],"performance","observability","performance observability"]