-
Notifications
You must be signed in to change notification settings - Fork 180
Description
Skill Feedback: db-core/collection-setup
Package: @tanstack/db
Skill version: 0.5.30
Rating: mixed
Task
Set up an Electric-backed TanStack DB collection with Zod schema, optimistic mutations, and live queries in a TanStack Start app.
What Worked
electricCollectionOptionsconfig shape was accurategetKey,onInsert/onUpdate/onDeletehandler patterns matched reality- txid handshake pattern (
return { txid }from handlers) was correct in concept - The warning about
queryFnreturning empty arrays was valuable context - Schema with
z.unionfor transformed fields (TInput superset of TOutput) was documented and saved time
What Failed
- No errors from this skill directly — the collection-setup patterns were accurate.
Missing
-
Complete Zod schema example for
electricCollectionOptions— The skill shows schemas forqueryCollectionOptionsbut the Electric adapter example just referencestodoSchemawithout defining it. Without a schema, the collection types asRecord<string, unknown>which causes type errors everywhere. A concrete Zod schema example paired with the Electric collection setup would prevent agents from guessing. -
localOnlyCollectionOptionsframing too strong — The skill says "Use localOnlyCollectionOptions for prototyping — the collection API is uniform, so swapping to a real backend later only changes the options creator." This is good advice in general, but the agent interpreted it as "default to local-only even when the user explicitly requests Electric." Consider reframing: "If you don't have a backend yet, use localOnlyCollectionOptions. If the user specifies a backend (e.g. Electric), use that adapter directly."
Self-Corrections
- Initially created collection with
localOnlyCollectionOptionsand Electric config commented out. User corrected this. Rewrote to useelectricCollectionOptionsdirectly.
User Comments
- User was frustrated that the agent defaulted to
localOnlyCollectionOptionswhen they explicitly said "with Electric"