Agent skill

Tanstack DB

by octanejs in octanejs/octane

Octane bindings for TanStack DB. An agent skill from octanejs/octane.

MITAuto-check passedDevelopment

Install Tanstack DB

skills CLI
$ npx skills add octanejs/octane --skill tanstack-db -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install octanejs/octane tanstack-db --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/octanejs/octane.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/tanstack-db/skills/tanstack-db .claude/skills/tanstack-db && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tanstack-db
GitHub stars
1.4k
Token cost
~2.7k tokens
SKILL.md length
416 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Octane bindings for TanStack DB. An agent skill from octanejs/octane.

  • Tasks that involve Error handling
  • SKILL.md covers Setup, Hooks, Includes (Hierarchical Data) and Virtual Properties, plus 2 more sections
  • Calls pnpm

What it does

Tanstack DB is an agent skill from octanejs/octane. Octane bindings for TanStack DB. useLiveQuery hook with dependency arrays (8 overloads: query function, config object, pre-created collection, disabled state via returning undefined/null). useLiveSuspenseQuery for Octane Suspense with Error Boundaries (data always defined). useLiveInfiniteQuery for cursor-based pagination (pageSize, fetchNextPage, hasNextPage, isFetchingNextPage). usePacedMutations for debounced Octane state updates. Return shape: data, state, collection, status, isLoading, isReady, isError…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Error handling. It works with TanStack. The repository describes itself as: React’s programming model, compiled. The successor to Inferno. The licence is MIT.

When your agent uses it

  • Tasks that involve Error handling

Example prompts

  • “/tanstack-db”

What it can do on your machine

Read from SKILL.md and the folder at commit 35eb3c7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tanstack DB loads about 2.7k tokens when it runs. Until then it costs about 148 tokens; SKILL.md has 416 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~148
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from octanejs/octane at commit 35eb3c7, republished under its MIT licence (© octanejs). 416 words, ~2,712 tokens.

Download SKILL.mdSave it as .claude/skills/tanstack-db/SKILL.md (or your agent's skills folder).
name
tanstack-db
description
Octane bindings for TanStack DB. useLiveQuery hook with dependency arrays (8 overloads: query function, config object, pre-created collection, disabled state via returning undefined/null). useLiveSuspenseQuery for Octane Suspense with Error Boundaries (data always defined). useLiveInfiniteQuery for cursor-based pagination (pageSize, fetchNextPage, hasNextPage, isFetchingNextPage). usePacedMutations for debounced Octane state updates. Return shape: data, state, collection, status, isLoading, isReady, isError. Import from @octanejs/tanstack-db (re-exports all of @tanstack/db).
type
framework
library
db
framework
octane
library_version
0.6.0
requires
db-core
sources
TanStack/db:docs/framework/octane/overview.md, TanStack/db:docs/guides/live-queries.md, TanStack/db:packages/octane-db/src/useLiveQuery.ts…

This skill builds on db-core. Read it first for collection setup, query builder, and mutation patterns.

TanStack DB — Octane

Setup

tsx
import { useLiveQuery, eq, not } from '@octanejs/tanstack-db'

function TodoList() {
  const { data: todos, isLoading } = useLiveQuery((q) =>
    q
      .from({ todo: todoCollection })
      .where(({ todo }) => not(todo.completed))
      .orderBy(({ todo }) => todo.created_at, 'asc'),
  )

  if (isLoading) return <div>Loading...</div>

  return (
    <ul>
      {todos.map((todo) => (
        <li key={todo.id}>{todo.text}</li>
      ))}
    </ul>
  )
}

@octanejs/tanstack-db re-exports everything from @tanstack/db. In Octane projects, import everything from @octanejs/tanstack-db.

Hooks

useLiveQuery
tsx
// Query function with dependency array
const {
  data,
  state,
  collection,
  status,
  isLoading,
  isReady,
  isError,
  isIdle,
  isCleanedUp,
} = useLiveQuery(
  (q) =>
    q
      .from({ todo: todoCollection })
      .where(({ todo }) => eq(todo.userId, userId)),
  [userId],
)

// Config object
const { data } = useLiveQuery({
  query: (q) => q.from({ todo: todoCollection }),
  gcTime: 60000,
})

// Pre-created collection (from route loader)
const { data } = useLiveQuery(preloadedCollection)

// Conditional query — return undefined/null to disable
const { data, status } = useLiveQuery(
  (q) => {
    if (!userId) return undefined
    return q
      .from({ todo: todoCollection })
      .where(({ todo }) => eq(todo.userId, userId))
  },
  [userId],
)
// When disabled: status='disabled', data=undefined
useLiveSuspenseQuery
tsx
// data is ALWAYS defined — never undefined
// Must wrap in <Suspense> and <ErrorBoundary>
function TodoList() {
  const { data: todos } = useLiveSuspenseQuery((q) =>
    q.from({ todo: todoCollection }),
  )

  return (
    <ul>
      {todos.map((t) => (
        <li key={t.id}>{t.text}</li>
      ))}
    </ul>
  )
}

// With deps — re-suspends when deps change
const { data } = useLiveSuspenseQuery(
  (q) =>
    q
      .from({ todo: todoCollection })
      .where(({ todo }) => eq(todo.category, category)),
  [category],
)
useLiveInfiniteQuery
tsx
const { data, fetchNextPage, hasNextPage, isFetchingNextPage } =
  useLiveInfiniteQuery(
    (q) =>
      q
        .from({ posts: postsCollection })
        .where(({ posts }) => eq(posts.category, category))
        .orderBy(({ posts }) => posts.createdAt, 'desc'),
    { pageSize: 20 },
    [category],
  )

// data is the flat array of all loaded pages
// fetchNextPage() loads the next page
// hasNextPage is true when more data is available
usePacedMutations
tsx
import { usePacedMutations, debounceStrategy } from "@octanejs/tanstack-db"

const mutate = usePacedMutations({
  onMutate: (value: string) => {
    noteCollection.update(noteId, (draft) => {
      draft.content = value
    })
  },
  mutationFn: async ({ transaction }) => {
    await api.notes.update(noteId, transaction.mutations[0].changes)
  },
  strategy: debounceStrategy({ wait: 500 }),
})

// In handler:
<textarea onChange={(e) => mutate(e.target.value)} />
useLiveQueryEffect
tsx
import { useLiveQueryEffect, eq } from '@octanejs/tanstack-db'

// Fire side effects when rows enter, exit, or update a query result.
// No render output — the effect is created on mount, disposed on unmount,
// and recreated when deps change.
function ChatComponent() {
  useLiveQueryEffect(
    {
      query: (q) =>
        q.from({ msg: messages }).where(({ msg }) => eq(msg.role, 'user')),
      skipInitial: true,
      onEnter: async (event) => {
        await generateResponse(event.value)
      },
    },
    [],
  )

  return <div>...</div>
}

Includes (Hierarchical Data)

When a query uses includes (subqueries in select), each child field is a live Collection by default. Subscribe to it with useLiveQuery in a subcomponent:

tsx
function ProjectList() {
  const { data: projects } = useLiveQuery((q) =>
    q.from({ p: projectsCollection }).select(({ p }) => ({
      id: p.id,
      name: p.name,
      issues: q
        .from({ i: issuesCollection })
        .where(({ i }) => eq(i.projectId, p.id))
        .select(({ i }) => ({ id: i.id, title: i.title })),
    })),
  )

  return (
    <ul>
      {projects.map((project) => (
        <li key={project.id}>
          {project.name}
          <IssueList issuesCollection={project.issues} />
        </li>
      ))}
    </ul>
  )
}

// Child component subscribes to the child Collection
function IssueList({ issuesCollection }) {
  const { data: issues } = useLiveQuery(issuesCollection)
  return (
    <ul>
      {issues.map((issue) => (
        <li key={issue.id}>{issue.title}</li>
      ))}
    </ul>
  )
}

Only the affected IssueList re-renders when an issue changes — the parent does not.

With toArray(), child results are plain arrays and the parent re-renders on child changes:

tsx
import { toArray, eq } from '@octanejs/tanstack-db'

const { data: projects } = useLiveQuery((q) =>
  q.from({ p: projectsCollection }).select(({ p }) => ({
    id: p.id,
    name: p.name,
    issues: toArray(
      q
        .from({ i: issuesCollection })
        .where(({ i }) => eq(i.projectId, p.id))
        .select(({ i }) => ({ id: i.id, title: i.title })),
    ),
  })),
)
// project.issues is Array<{ id, title }> — no subcomponent needed

See db-core/live-queries/SKILL.md for full includes rules (correlation conditions, nested includes, aggregates).

Virtual Properties

Live query results include computed, read-only virtual properties on every row:

  • $synced: true when the row is confirmed by sync; false when it is still optimistic.
  • $origin: "local" if the last confirmed change came from this client, otherwise "remote".
  • $key: the row key for the result.
  • $collectionId: the source collection ID.

These props are added automatically and can be used in where, select, and orderBy clauses. Do not persist them back to storage.

tsx
const { data } = useLiveQuery(
  (q) =>
    q
      .from({ todo: todoCollection })
      .where(({ todo }) => eq(todo.$synced, false)),
  [],
)
// Shows only optimistic (unconfirmed) todos

Octane-Specific Patterns

Dependency arrays
tsx
// Include ALL external reactive values
const { data } = useLiveQuery(
  (q) =>
    q
      .from({ todo: todoCollection })
      .where(({ todo }) =>
        and(eq(todo.userId, userId), eq(todo.status, filter)),
      ),
  [userId, filter],
)

// Empty array = static query, never re-runs
const { data } = useLiveQuery((q) => q.from({ todo: todoCollection }), [])

// No array = re-runs on every render (usually wrong)
Suspense + Error Boundary
tsx
<ErrorBoundary fallback={<div>Error</div>}>
  <Suspense fallback={<div>Loading...</div>}>
    <TodoList />
  </Suspense>
</ErrorBoundary>
Router loader preloading
tsx
// In route loader:
await todoCollection.preload()

// In component — data available immediately:
const { data } = useLiveQuery((q) => q.from({ todo: todoCollection }))

See meta-framework/SKILL.md for full preloading patterns.

Common Mistakes

CRITICAL Missing external values in dependency array

Wrong:

tsx
const { data } = useLiveQuery((q) =>
  q.from({ todo: todoCollection }).where(({ todo }) => eq(todo.userId, userId)),
)

Correct:

tsx
const { data } = useLiveQuery(
  (q) =>
    q
      .from({ todo: todoCollection })
      .where(({ todo }) => eq(todo.userId, userId)),
  [userId],
)

When the query uses external state not in the deps array, the query won't re-run when that value changes, showing stale results.

Source: docs/framework/octane/overview.md

HIGH useLiveSuspenseQuery without Error Boundary

Wrong:

tsx
<Suspense fallback={<div>Loading...</div>}>
  <TodoList /> {/* uses useLiveSuspenseQuery */}
</Suspense>

Correct:

tsx
<ErrorBoundary fallback={<div>Error</div>}>
  <Suspense fallback={<div>Loading...</div>}>
    <TodoList />
  </Suspense>
</ErrorBoundary>

useLiveSuspenseQuery throws errors during rendering. Without an Error Boundary, the entire app crashes.

Source: docs/guides/live-queries.md

Show full SKILL.md (164 more words)Show less
HIGH "Not a Collection" error from duplicate @tanstack/db

If useLiveQuery throws InvalidSourceError: The value provided for alias "todo" is not a Collection, it usually means two copies of @tanstack/db are installed. The collection was created by one copy, but useLiveQuery checks instanceof against the other.

In dev mode, TanStack DB also throws DuplicateDbInstanceError if two instances are detected.

Diagnose:

bash
pnpm ls @tanstack/db

If multiple versions appear, fix with one of:

pnpm overrides (in root package.json):

json
{
  "pnpm": {
    "overrides": {
      "@tanstack/db": "^0.6.0"
    }
  }
}

Vite resolve.alias (in vite.config.ts):

ts
import path from 'path'

export default defineConfig({
  resolve: {
    alias: {
      '@tanstack/db': path.resolve('./node_modules/@tanstack/db'),
    },
  },
})

The root cause is typically a dependency that bundles its own copy instead of declaring @tanstack/db as a peerDependency.

HIGH Tension: Query expressiveness vs. IVM constraints

The query builder looks like SQL but has constraints that SQL doesn't — equality joins only, orderBy required for limit/offset, no distinct without select. Agents write SQL-style queries that violate these constraints. See db-core/live-queries/SKILL.md § Common Mistakes for all constraints.

See also: db-core/live-queries/SKILL.md — for query builder API and all operators.

See also: db-core/mutations-optimistic/SKILL.md — for mutation patterns.

See also: meta-framework/SKILL.md — for preloading in route loaders.

© octanejs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/tanstack-db/skills/tanstack-db of octanejs/octane.

Open the folder on GitHubat commit 35eb3c7

Compare with similar skills

Tanstack DB next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tanstack DB compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tanstack DB this skilloctanejs/octane1.4k—~2.7kAutomated safety check: PassMIT
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Nextjs Data Fetchinggiuseppe-trisciuoglio/developer-kit355—~2.2kAutomated safety check: NotesMIT
Expo Data Fetchingexpo/skills2.7k—~3.4kAutomated safety check: NotesMIT
Adynato Mobile APImajiayu000/claude-skill-registry6661 repos~2.5kAutomated safety check: PassMIT
API Clientaiskillstore/marketplace4301 repos~5.1kAutomated safety check: NotesNone

Similar skills

  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Nextjs Data Fetching

    giuseppe-trisciuoglio/developer-kit

    Provides Next.js App Router data fetching patterns including SWR and React Query integration, parallel data fetching, Incremental Static Regeneration (ISR), revalidation strategies, and error…

    355 GitHub stars~2.2k tokensUpdated 27 days ago
    Backend & APIsAuto-check: notes
  • Official

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    2.7k GitHub stars~3.4k tokensUpdated yesterday
    MobileAuto-check: notes
  • Adynato Mobile API

    majiayu000/claude-skill-registry

    API integration patterns for Adynato mobile apps. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 1 repo~2.5k tokens
    MobileAuto-check passed
  • API Client

    aiskillstore/marketplace

    A skill your agent uses when setting up API clients - TanStack Query, Axios, JWT token management, error handling, or response parsing.

    430 GitHub starsUsed in 1 repo~5.1k tokens
    Backend & APIsAuto-check: notes
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    69k GitHub stars~2k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from octanejs/octane

All 17 skills in this repo
  • Update Bindings

    octanejs/octane

    Audit one, several, or all existing Octane bindings; implement selected maintenance findings or remove redundant copied files with evidence matched to source ownership.

    1.4k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Handle Issue

    octanejs/octane

    Work a GitHub issue in the octane repo. An agent skill from octanejs/octane.

    1.4k GitHub stars~638 tokensUpdated today
    Auto-check passed
  • Migrate V8 To V9

    octanejs/octane

    Perform a complete @tanstack/react-table v8-to-v9 migration: hook and feature architecture, row-model slots, React state and subscriptions, rendering, composable tables, type helpers, and every…

    1.4k GitHub stars~4.7k tokensUpdated today
    Auto-check passed
  • Performance Audit

    octanejs/octane

    Audit or defend Octane performance. An agent skill from octanejs/octane.

    1.4k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Implement and verify new React-library ports or copied/rewritten React surfaces in Octane bindings from npm names or npm/GitHub links/lists.

    1.4k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Triage

    octanejs/octane

    Work out which part of the octane monorepo owns an unfamiliar failure or task.

    1.4k GitHub stars~374 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Tanstack DB

What does Tanstack DB do?

Octane bindings for TanStack DB. An agent skill from octanejs/octane. Tanstack DB is an agent skill from octanejs/octane. Octane bindings for TanStack DB.

When should I use Tanstack DB?

Tanstack DB fits situations like: tasks that involve Error handling.

How do I install Tanstack DB in Claude Code?

Run `npx skills add octanejs/octane --skill tanstack-db -a claude-code`. Or copy the skill folder (packages/tanstack-db/skills/tanstack-db in octanejs/octane) into .claude/skills/tanstack-db in your project. Claude Code loads it when a task matches its description.

How do I install Tanstack DB in Codex?

Run `npx skills add octanejs/octane --skill tanstack-db -a codex`. Or copy the skill folder (packages/tanstack-db/skills/tanstack-db in octanejs/octane) into .agents/skills/tanstack-db in your project. Codex loads it when a task matches its description.

Can I use Tanstack DB in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add octanejs/octane --skill tanstack-db -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tanstack-db, .gemini/skills/tanstack-db, .github/skills/tanstack-db and .opencode/skills/tanstack-db in your project.

What does Tanstack DB need to run?

Going by SKILL.md and its folder, Tanstack DB needs the command-line tools its instructions call (pnpm).

Does Tanstack DB access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tanstack DB safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tanstack DB use?

Tanstack DB is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tanstack DB use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tanstack DB?

Skills that share tags, products or a category with Tanstack DB: Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars), Nextjs Data Fetching (giuseppe-trisciuoglio/developer-kit, 355 stars), Expo Data Fetching (expo/skills, 2.7k stars) and Adynato Mobile API (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tanstack DB?

octanejs (a GitHub organization) maintains it in octanejs/octane, which has 1,449 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: octanejs/octane on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.