Skip to content

Skill Feedback: db-core/collection-setup (mixed) #1335

@KyleAMathews

Description

@KyleAMathews

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

  1. 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.

  2. 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions