SKILL.md--- name: build-with-tinybase description: Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, resolving TinyBase import paths, configuring browser or database persistence, configuring MergeableStore synchronization over WebSockets or Cloudflare Durable Objects, or diagnosing an existing TinyBase application. --- # Build With TinyBase Prefer a current generated application over reconstructing TinyBase setup from memory. Preserve persistence and synchronization lifecycle ordering, and verify the behavior the user actually needs. ## Read The References Do not recall TinyBase API details from memory. Read the reference covering the task before writing code: | Reference | Read it when | | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | [references/architecture.md](references/architecture.md) | Choosing between Store and MergeableStore, a persistence backend, a synchronization approach, or UI bindings | | [references/import-paths.md](references/import-paths.md) | Importing anything outside the `tinybase` root, or checking which Persisters accept a MergeableStore | | [references/lifecycle.md](references/lifecycle.md) | Creating, starting, reconnecting, or destroying a Persister or Synchronizer, or setting WebSocket paths and channel Ids | | [references/durable-objects.md](references/durable-objects.md) | Building or debugging a Cloudflare Durable Object sync server | ## Select The Architecture Read [references/architecture.md](references/architecture.md) when choosing between Store and MergeableStore, persistence backends, synchronization, or UI bindings. Confirm that TinyBase fits the task: - Keep the active application dataset in a JavaScript runtime. - Use TinyBase for reactive tabular or key-value data, local-first behavior, persistence, synchronization, or framework bindings. - Do not present TinyBase as a hosted database service. - Pair it with another database or service when the authoritative dataset is unbounded, primarily queried on a server, or requires managed backend facilities. ## Scaffold A New Application Inspect the installed generator contract first: ```sh npm create tinybase@latest -- --list-options ``` Translate the user's requirements into explicit values. Generate unattended projects with every applicable option and always disable automatic installation and server startup: ```sh npm create tinybase@latest -- \ --non-interactive \ --projectName my-tinybase-app \ --appType todos \ --language typescript \ --framework react \ --tinyWidgets false \ --schemas true \ --syncType none \ --persistenceType local-stora