$npx -y skills add tinyplex/tinybase --skill build-with-tinybaseScaffold, 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, configuring browser or database persi
| 1 | # Build With TinyBase |
| 2 | |
| 3 | Prefer a current generated application over reconstructing TinyBase setup from |
| 4 | memory. Preserve persistence and synchronization lifecycle ordering, and verify |
| 5 | the behavior the user actually needs. |
| 6 | |
| 7 | ## Select The Architecture |
| 8 | |
| 9 | Read [references/architecture.md](references/architecture.md) when choosing |
| 10 | between Store and MergeableStore, persistence backends, synchronization, or UI |
| 11 | bindings. |
| 12 | |
| 13 | Confirm that TinyBase fits the task: |
| 14 | |
| 15 | - Keep the active application dataset in a JavaScript runtime. |
| 16 | - Use TinyBase for reactive tabular or key-value data, local-first behavior, |
| 17 | persistence, synchronization, or framework bindings. |
| 18 | - Do not present TinyBase as a hosted database service. |
| 19 | - Pair it with another database or service when the authoritative dataset is |
| 20 | unbounded, primarily queried on a server, or requires managed backend |
| 21 | facilities. |
| 22 | |
| 23 | ## Scaffold A New Application |
| 24 | |
| 25 | Inspect the installed generator contract first: |
| 26 | |
| 27 | ```sh |
| 28 | npm create tinybase@latest -- --list-options |
| 29 | ``` |
| 30 | |
| 31 | Translate the user's requirements into explicit values. Generate unattended |
| 32 | projects with every applicable option and always disable automatic installation |
| 33 | and server startup: |
| 34 | |
| 35 | ```sh |
| 36 | npm create tinybase@latest -- \ |
| 37 | --non-interactive \ |
| 38 | --projectName my-tinybase-app \ |
| 39 | --appType todos \ |
| 40 | --language typescript \ |
| 41 | --framework react \ |
| 42 | --tinyWidgets false \ |
| 43 | --schemas true \ |
| 44 | --syncType none \ |
| 45 | --persistenceType local-storage \ |
| 46 | --prettier true \ |
| 47 | --eslint true \ |
| 48 | --installAndRun false |
| 49 | ``` |
| 50 | |
| 51 | Run the generator in the parent directory that should contain the new project. |
| 52 | Do not overwrite an existing directory. After generation: |
| 53 | |
| 54 | 1. Read the generated `AGENTS.md` and `README.md`. |
| 55 | 2. Inspect the primary Store file before modifying application code. |
| 56 | 3. Install dependencies only when authorized and required. |
| 57 | 4. Make application-specific changes within the generated architecture. |
| 58 | 5. Run the generated client build. |
| 59 | 6. Run the server build when server code changed. |
| 60 | |
| 61 | ## Extend An Existing Application |
| 62 | |
| 63 | Inspect `package.json`, TinyBase imports, Store creation, Persister setup, and |
| 64 | Synchronizer setup before editing. Use documentation matching the installed |
| 65 | TinyBase version. Start at https://tinybase.org/llms.txt or retrieve current |
| 66 | TinyBase documentation through Context7 when available. |
| 67 | |
| 68 | Keep these boundaries clear: |
| 69 | |
| 70 | - Store creation and schemas |
| 71 | - persistence startup and teardown |
| 72 | - synchronization startup and teardown |
| 73 | - framework Provider or context wiring |
| 74 | - application-specific data and UI |
| 75 | |
| 76 | Reuse existing imports and patterns when they are current. Import integrations |
| 77 | from their specific `tinybase/...` subpaths. Avoid adding a second source of |
| 78 | truth in component state for data already owned by TinyBase. |
| 79 | |
| 80 | ## Verify The Outcome |
| 81 | |
| 82 | Match verification to the requested behavior: |
| 83 | |
| 84 | - Run the project's build or type check after code changes. |
| 85 | - For persistence, change data and perform a real reload or restart. |
| 86 | - For synchronization, connect two clients to the same channel or room and |
| 87 | confirm changes propagate in both directions. |
| 88 | - Test reconnection when synchronization behavior changes. |
| 89 | - Confirm schema rejection and inferred types when changing schemas. |
| 90 | - Report any verification that could not be performed. |
| 91 | |
| 92 | Do not treat compilation alone as proof of persistence or synchronization. |