Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

skill_tree.yaml

290 lines11.7 KB

1# _artifacts/skill_tree.yaml
2library:
3 name: '@tanstack/db'
4 version: '0.5.30'
5 repository: 'https://github.com/TanStack/db'
6 description: 'Reactive client store with normalized collections, sub-millisecond live queries, and instant optimistic mutations'
7generated_from:
8 domain_map: 'domain_map.yaml'
9 skill_spec: 'skill_spec.md'
10generated_at: '2026-03-04'
11​
12skills:
13 # ─── Core overview (entry point) ───
14 - name: 'db-core'
15 slug: 'db-core'
16 type: 'core'
17 domain: 'collection-setup'
18 path: 'skills/db-core/SKILL.md'
19 package: 'packages/db'
20 description: >
21 TanStack DB core concepts: createCollection, live queries via query builder,
22 optimistic mutations with draft proxy, transaction lifecycle. Entry point
23 for all TanStack DB skills with sub-skill routing table.
24 sources:
25 - 'TanStack/db:docs/overview.md'
26 - 'TanStack/db:packages/db/src/index.ts'
27​
28 # ─── Core sub-skills ───
29 - name: 'Collection Setup'
30 slug: 'db-core/collection-setup'
31 type: 'sub-skill'
32 domain: 'collection-setup'
33 path: 'skills/db-core/collection-setup/SKILL.md'
34 package: 'packages/db'
35 description: >
36 Creating typed collections with createCollection, queryCollectionOptions,
37 electricCollectionOptions, powerSyncCollectionOptions, rxdbCollectionOptions,
38 trailbaseCollectionOptions, localOnlyCollectionOptions, localStorageCollectionOptions.
39 CollectionConfig (getKey, schema, sync, gcTime, autoIndex, syncMode).
40 StandardSchema validation with Zod/Valibot/ArkType. Collection lifecycle
41 (idle/loading/ready/error/cleaned-up). Adapter-specific sync patterns.
42 requires:
43 - 'db-core'
44 sources:
45 - 'TanStack/db:docs/overview.md'
46 - 'TanStack/db:docs/guides/schemas.md'
47 - 'TanStack/db:docs/collections/query-collection.md'
48 - 'TanStack/db:docs/collections/electric-collection.md'
49 - 'TanStack/db:docs/collections/powersync-collection.md'
50 - 'TanStack/db:docs/collections/rxdb-collection.md'
51 - 'TanStack/db:docs/collections/trailbase-collection.md'
52 - 'TanStack/db:docs/collections/local-only-collection.md'
53 - 'TanStack/db:docs/collections/local-storage-collection.md'
54 - 'TanStack/db:packages/db/src/collection/index.ts'
55 subsystems:
56 - 'TanStack Query adapter'
57 - 'ElectricSQL adapter'
58 - 'PowerSync adapter'
59 - 'RxDB adapter'
60 - 'TrailBase adapter'
61 - 'Local-only'
62 - 'localStorage'
63 references:
64 - 'references/query-adapter.md'
65 - 'references/electric-adapter.md'
66 - 'references/powersync-adapter.md'
67 - 'references/rxdb-adapter.md'
68 - 'references/trailbase-adapter.md'
69 - 'references/local-adapters.md'
70 - 'references/schema-patterns.md'
71​
72 - name: 'Live Queries'
73 slug: 'db-core/live-queries'
74 type: 'sub-skill'
75 domain: 'live-queries'
76 path: 'skills/db-core/live-queries/SKILL.md'
77 package: 'packages/db'
78 description: >
79 Query builder fluent API: from, where, join, leftJoin, rightJoin, innerJoin,
80 fullJoin, select, fn.select, groupBy, having, orderBy, limit, offset, distinct,
81 findOne. Operators: eq, gt, gte, lt, lte, like, ilike, inArray, isNull,
82 isUndefined, and, or, not. Aggregates: count, sum, avg, min, max. String
83 functions: upper, lower, length, concat, coalesce. Math: add.
84 $selected namespace. createLiveQueryCollection for
85 standalone queries. Derived collections. Predicate push-down. IVM via
86 differential dataflow (d2ts).
87 requires:
88 - 'db-core'
89 sources:
90 - 'TanStack/db:docs/guides/live-queries.md'
91 - 'TanStack/db:packages/db/src/query/builder/index.ts'
92 - 'TanStack/db:packages/db/src/query/compiler/index.ts'
93 - 'TanStack/db:packages/db-ivm/src/index.ts'
94 references:
95 - 'references/operators.md'
96​
97 - name: 'Mutations & Optimistic State'
98 slug: 'db-core/mutations-optimistic'
99 type: 'sub-skill'
100 domain: 'mutations-optimistic'
101 path: 'skills/db-core/mutations-optimistic/SKILL.md'
102 package: 'packages/db'
103 description: >
104 collection.insert, collection.update (Immer-style draft proxy),
105 collection.delete. createOptimisticAction (onMutate + mutationFn).
106 createPacedMutations with debounceStrategy, throttleStrategy, queueStrategy.
107 createTransaction, getActiveTransaction, ambient transaction context.
108 Transaction lifecycle (pending/persisting/completed/failed). Mutation merging
109 (insert+update→insert, insert+delete→cancel). onInsert/onUpdate/onDelete
110 handlers. PendingMutation (original, modified, changes, globalKey).
111 Transaction.isPersisted promise. TanStack Pacer integration.
112 requires:
113 - 'db-core'
114 sources:
115 - 'TanStack/db:docs/guides/mutations.md'
116 - 'TanStack/db:packages/db/src/transactions.ts'
117 - 'TanStack/db:packages/db/src/optimistic-action.ts'
118 - 'TanStack/db:packages/db/src/paced-mutations.ts'
119 - 'TanStack/db:packages/db/src/collection/mutations.ts'
120 references:
121 - 'references/transaction-api.md'
122​
123 - name: 'Custom Adapter Authoring'
124 slug: 'db-core/custom-adapter'
125 type: 'sub-skill'
126 domain: 'custom-adapter'
127 path: 'skills/db-core/custom-adapter/SKILL.md'
128 package: 'packages/db'
129 description: >
130 Building custom collection adapters. SyncConfig interface: sync function
131 receiving begin, write, commit, markReady, truncate primitives. ChangeMessage
132 format. loadSubset for on-demand sync. LoadSubsetOptions (where, orderBy,
133 limit, cursor). Expression parsing: parseWhereExpression,
134 parseOrderByExpression, extractSimpleComparisons, parseLoadSubsetOptions.
135 Collection options creator pattern. Subscription lifecycle and cleanup.
136 requires:
137 - 'db-core'
138 - 'db-core/collection-setup'
139 sources:
140 - 'TanStack/db:docs/guides/collection-options-creator.md'
141 - 'TanStack/db:packages/db/src/collection/sync.ts'
142 - 'TanStack/db:packages/db/src/query/ir.ts'
143​
144 # ─── Framework skills (one per adapter package) ───
145 - name: 'React DB'
146 slug: 'react-db'
147 type: 'framework'
148 domain: 'framework-integration'
149 path: 'skills/react-db/SKILL.md'
150 package: 'packages/react-db'
151 description: >
152 React bindings for TanStack DB. useLiveQuery hook with dependency arrays
153 and 8 overloads (query function, config object, pre-created collection,
154 disabled state). useLiveSuspenseQuery for React Suspense with Error Boundaries.
155 useLiveInfiniteQuery for cursor-based pagination (pageSize, fetchNextPage,
156 hasNextPage). usePacedMutations for debounced React state. Return shape:
157 data, state, collection, status, isLoading, isReady, isError.
158 requires:
159 - 'db-core'
160 sources:
161 - 'TanStack/db:docs/framework/react/overview.md'
162 - 'TanStack/db:packages/react-db/src/useLiveQuery.ts'
163 - 'TanStack/db:packages/react-db/src/useLiveInfiniteQuery.ts'
164 - 'TanStack/db:packages/react-db/src/usePacedMutations.ts'
165​
166 - name: 'Preact DB'
167 slug: 'preact-db'
168 type: 'framework'
169 domain: 'framework-integration'
170 path: 'skills/preact-db/SKILL.md'
171 package: 'packages/preact-db'
172 description: >
173 Preact bindings for TanStack DB. useLiveQuery and useLiveInfiniteQuery
174 hooks with identity derived from query IR; functional variants need
175 queryKey.
176 requires:
177 - 'db-core'
178 sources:
179 - 'TanStack/db:docs/framework/preact/overview.md'
180 - 'TanStack/db:packages/preact-db/src/useLiveQuery.ts'
181 - 'TanStack/db:packages/preact-db/src/useLiveInfiniteQuery.ts'
182​
183 - name: 'Vue DB'
184 slug: 'vue-db'
185 type: 'framework'
186 domain: 'framework-integration'
187 path: 'skills/vue-db/SKILL.md'
188 package: 'packages/vue-db'
189 description: >
190 Vue bindings for TanStack DB. useLiveQuery composable with
191 MaybeRefOrGetter query functions and ComputedRef return values.
192 Reactive deps via Vue refs and computed properties.
193 requires:
194 - 'db-core'
195 sources:
196 - 'TanStack/db:docs/framework/vue/overview.md'
197 - 'TanStack/db:packages/vue-db/src/useLiveQuery.ts'
198​
199 - name: 'Svelte DB'
200 slug: 'svelte-db'
201 type: 'framework'
202 domain: 'framework-integration'
203 path: 'skills/svelte-db/SKILL.md'
204 package: 'packages/svelte-db'
205 description: >
206 Svelte 5 bindings for TanStack DB. useLiveQuery with Svelte 5 runes
207 ($state reactivity). Dependency arrays with getter functions for props.
208 requires:
209 - 'db-core'
210 sources:
211 - 'TanStack/db:docs/framework/svelte/overview.md'
212 - 'TanStack/db:packages/svelte-db/src/useLiveQuery.svelte.ts'
213​
214 - name: 'Solid DB'
215 slug: 'solid-db'
216 type: 'framework'
217 domain: 'framework-integration'
218 path: 'skills/solid-db/SKILL.md'
219 package: 'packages/solid-db'
220 description: >
221 SolidJS bindings for TanStack DB. useLiveQuery with fine-grained
222 reactivity (Accessor, createSignal). Signal reads must happen inside
223 the query function for tracking.
224 requires:
225 - 'db-core'
226 sources:
227 - 'TanStack/db:docs/framework/solid/overview.md'
228 - 'TanStack/db:packages/solid-db/src/useLiveQuery.ts'
229​
230 - name: 'Angular DB'
231 slug: 'angular-db'
232 type: 'framework'
233 domain: 'framework-integration'
234 path: 'skills/angular-db/SKILL.md'
235 package: 'packages/angular-db'
236 description: >
237 Angular bindings for TanStack DB. injectLiveQuery with Angular Signals.
238 Must be called in injection context. Supports reactive params via
239 { params: () => T, query: ({ params, q }) => QueryBuilder } pattern.
240 Uses inject(DestroyRef) for cleanup.
241 requires:
242 - 'db-core'
243 sources:
244 - 'TanStack/db:docs/framework/angular/overview.md'
245 - 'TanStack/db:packages/angular-db/src/inject-live-query.ts'
246​
247 # ─── Composition skills ───
248 - name: 'Meta-Framework Integration'
249 slug: 'meta-framework'
250 type: 'composition'
251 domain: 'meta-framework'
252 path: 'skills/meta-framework/SKILL.md'
253 package: 'packages/db'
254 description: >
255 Client-side preloading of TanStack DB collections in route loaders.
256 collection.preload(), stateWhenReady(), toArrayWhenReady(), onFirstReady().
257 Pre-creating createLiveQueryCollection in loaders. Setting ssr: false on
258 routes (SSR not yet supported). TanStack Start and TanStack Router loader
259 patterns. Coordinating collection lifecycle with route transitions.
260 requires:
261 - 'db-core'
262 - 'db-core/collection-setup'
263 sources:
264 - 'TanStack/db:docs/guides/live-queries.md'
265 - 'TanStack/db:examples/react/projects/src/routes/_authenticated/project/$projectId.tsx'
266 - 'TanStack/db:examples/react/projects/README.md'
267​
268 # ─── Offline skill ───
269 - name: 'Offline Transactions'
270 slug: 'offline'
271 type: 'composition'
272 domain: 'offline'
273 path: 'skills/offline/SKILL.md'
274 package: 'packages/offline-transactions'
275 description: >
276 Offline-first transaction queueing with @tanstack/offline-transactions.
277 OfflineExecutor, startOfflineExecutor, OfflineConfig (collections,
278 mutationFns, storage, maxConcurrency). Storage adapters (IndexedDBAdapter,
279 LocalStorageAdapter). Retry policies (DefaultRetryPolicy, BackoffCalculator,
280 NonRetriableError). Leader election (WebLocksLeader, BroadcastChannelLeader).
281 Online detection (WebOnlineDetector). OutboxManager, KeyScheduler,
282 TransactionSerializer. React Native support via @react-native-community/netinfo.
283 requires:
284 - 'db-core'
285 - 'db-core/mutations-optimistic'
286 sources:
287 - 'TanStack/db:packages/offline-transactions/src/index.ts'
288 - 'TanStack/db:packages/offline-transactions/src/offline-executor.ts'
289 - 'TanStack/db:packages/offline-transactions/src/outbox.ts'
290 - 'TanStack/db:packages/offline-transactions/src/leader/'