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
electricCollectionOptions config shape was accurate
getKey, onInsert/onUpdate/onDelete handler patterns matched reality
- txid handshake pattern (
return { txid } from handlers) was correct in concept
- The warning about
queryFn returning empty arrays was valuable context
- Schema with
z.union for 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 for queryCollectionOptions but the Electric adapter example just references todoSchema without defining it. Without a schema, the collection types as Record<string, unknown> which causes type errors everywhere. A concrete Zod schema example paired with the Electric collection setup would prevent agents from guessing.
-
localOnlyCollectionOptions framing 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
localOnlyCollectionOptions and Electric config commented out. User corrected this. Rewrote to use electricCollectionOptions directly.
User Comments
- User was frustrated that the agent defaulted to
localOnlyCollectionOptions when they explicitly said "with Electric"
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 realityreturn { txid }from handlers) was correct in conceptqueryFnreturning empty arrays was valuable contextz.unionfor transformed fields (TInput superset of TOutput) was documented and saved timeWhat Failed
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
localOnlyCollectionOptionsand Electric config commented out. User corrected this. Rewrote to useelectricCollectionOptionsdirectly.User Comments
localOnlyCollectionOptionswhen they explicitly said "with Electric"