Skip to content

docs: update agent skills for current APIs#1696

Open
KyleAMathews wants to merge 2 commits into
mainfrom
codex/update-skills-from-code
Open

docs: update agent skills for current APIs#1696
KyleAMathews wants to merge 2 commits into
mainfrom
codex/update-skills-from-code

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

This updates TanStack DB agent skills to match the current public APIs and behavior through @tanstack/db 0.6.17. Agents will now receive accurate guidance for query collections, live queries, mutations, persistence, adapters, and framework integrations instead of stale examples and defaults.

Approach

  • Audited code, JSDoc, tests, and docs added since the prior skill refresh.
  • Updated Query Collection guidance for eager and on-demand ownership, initial data, cancellation, invalidation, response envelopes, and scoped QueryClient usage.
  • Documented current live-query operators and semantics, including materialize, arithmetic expressions, null/NaN behavior, virtual properties, and garbage collection.
  • Corrected custom adapter contracts, mutation settlement semantics, safe UUID generation, SQLite persistence coordination and pruning, and Electric/RxDB/TrailBase details.
  • Updated Angular, React, Solid, Svelte, Vue, meta-framework, and offline-transaction skills where runtime behavior changed.
  • Bumped skill compatibility metadata to 0.6.17 and added patch changesets for every package that ships a changed skill.

Key invariants

  • Examples use exports, option names, return shapes, and defaults that exist in the current source.
  • Eager, on-demand, and Electric progressive behavior remain distinct.
  • Query cache ownership and collection ownership are described separately.
  • These are documentation-only changes; no runtime behavior changes.

Non-goals

  • Replacing the full product documentation or generated API reference.
  • Changing package APIs, implementation behavior, or release policy.

Verification

git diff --check origin/main
pnpm exec prettier --check <changed Markdown files>

Frontmatter and relative Markdown links were also validated across all changed skill files.

Files changed

  • packages/db/skills/db-core/**: core setup, queries, adapters, mutations, and persistence guidance.
  • packages/db/skills/meta-framework/SKILL.md: scoped collection ownership and loader patterns.
  • Framework skill files under Angular, React, Solid, Svelte, and Vue: current hook and lifecycle behavior.
  • packages/offline-transactions/skills/offline/SKILL.md: current UUID guidance.
  • .changeset/update-agent-skills.md: patch entries for all seven affected packages.

Summary by CodeRabbit

  • Documentation
    • Updated TanStack DB skill guides and examples to version 0.6.17.
    • Clarified synchronization modes, query behavior, persistence, transactions, optimistic updates, adapters, and collection ownership.
    • Added guidance for safe UUID generation across supported environments.
    • Expanded live-query operator documentation, including math functions and nullish-value semantics.
    • Improved framework-specific examples for Angular, React, Solid, Svelte, and Vue integrations.
  • Chores
    • Prepared patch releases for database-related packages.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates TanStack DB skill documentation and package patch metadata to version 0.6.17, covering current collection, query, adapter, persistence, transaction, and framework APIs and behavior.

Changes

Skill documentation refresh

Layer / File(s) Summary
Version and framework skill alignment
.changeset/*, packages/angular-db/skills/*, packages/db/skills/db-core/SKILL.md, packages/{offline-transactions,react-db,solid-db,svelte-db,vue-db}/skills/*
Package skill versions are updated to 0.6.17, with refreshed Angular defaults, offline UUID examples, framework guidance, and changeset patch declarations.
Collection setup and adapter guidance
packages/db/skills/db-core/collection-setup/*
Collection ownership semantics, adapter configuration, sync modes, local identifiers, adapter-owned handlers, and safe UUID usage are documented across collection and adapter references.
Query collections and live-query semantics
packages/db/skills/db-core/collection-setup/references/query-adapter.md, packages/db/skills/db-core/live-queries/*
Query options, initial data, projections, scoped collections, invalidation, subset ownership, operators, materialization, comparison behavior, and unsafe aliases are documented.
Custom sync and persistence lifecycle
packages/db/skills/db-core/custom-adapter/SKILL.md, packages/db/skills/db-core/persistence/SKILL.md, packages/db/skills/meta-framework/SKILL.md
Custom adapters now show transactional on-demand loading and guarded metadata; persistence docs cover coordinators, Electron cleanup, and log pruning; meta-framework guidance covers scoped collection ownership.
Optimistic transaction behavior
packages/db/skills/db-core/mutations-optimistic/*
Transaction lifecycle, ambient scope, cancellation, auto-commit, persistence promises, backend observation, and safe UUID examples are updated.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • TanStack/db#1593: Related updates replacing crypto.randomUUID() examples with safeRandomUUID.
  • TanStack/db#1538: Related clarification of synchronous transaction context across await boundaries.
  • TanStack/db#1653: Related query-adapter option and compatibility documentation updates.

Suggested reviewers: samwillis

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the scope well, but it does not follow the required template headings or include the checklist and release-impact checkboxes. Reformat it to the repository template with 🎯 Changes, ✅ Checklist, and 🚀 Release Impact sections, including the required checkbox items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: updating agent skills for current APIs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-skills-from-code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-db

npm i https://pkg.pr.new/@tanstack/angular-db@1696

@tanstack/browser-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@1696

@tanstack/capacitor-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@1696

@tanstack/cloudflare-durable-objects-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@1696

@tanstack/db

npm i https://pkg.pr.new/@tanstack/db@1696

@tanstack/db-ivm

npm i https://pkg.pr.new/@tanstack/db-ivm@1696

@tanstack/db-sqlite-persistence-core

npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@1696

@tanstack/electric-db-collection

npm i https://pkg.pr.new/@tanstack/electric-db-collection@1696

@tanstack/electron-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@1696

@tanstack/expo-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@1696

@tanstack/node-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@1696

@tanstack/offline-transactions

npm i https://pkg.pr.new/@tanstack/offline-transactions@1696

@tanstack/powersync-db-collection

npm i https://pkg.pr.new/@tanstack/powersync-db-collection@1696

@tanstack/query-db-collection

npm i https://pkg.pr.new/@tanstack/query-db-collection@1696

@tanstack/react-db

npm i https://pkg.pr.new/@tanstack/react-db@1696

@tanstack/react-native-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@1696

@tanstack/rxdb-db-collection

npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@1696

@tanstack/solid-db

npm i https://pkg.pr.new/@tanstack/solid-db@1696

@tanstack/svelte-db

npm i https://pkg.pr.new/@tanstack/svelte-db@1696

@tanstack/tauri-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@1696

@tanstack/trailbase-db-collection

npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@1696

@tanstack/vue-db

npm i https://pkg.pr.new/@tanstack/vue-db@1696

commit: 39c8713

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 125 kB

ℹ️ View Unchanged
Filename Size
packages/db/dist/esm/collection/change-events.js 1.43 kB
packages/db/dist/esm/collection/changes.js 1.38 kB
packages/db/dist/esm/collection/cleanup-queue.js 810 B
packages/db/dist/esm/collection/events.js 434 B
packages/db/dist/esm/collection/index.js 3.62 kB
packages/db/dist/esm/collection/indexes.js 1.99 kB
packages/db/dist/esm/collection/lifecycle.js 1.69 kB
packages/db/dist/esm/collection/mutations.js 2.47 kB
packages/db/dist/esm/collection/state.js 5.48 kB
packages/db/dist/esm/collection/subscription.js 3.74 kB
packages/db/dist/esm/collection/sync.js 2.88 kB
packages/db/dist/esm/collection/transaction-metadata.js 144 B
packages/db/dist/esm/deferred.js 207 B
packages/db/dist/esm/errors.js 5.1 kB
packages/db/dist/esm/event-emitter.js 748 B
packages/db/dist/esm/index.js 3.16 kB
packages/db/dist/esm/indexes/auto-index.js 829 B
packages/db/dist/esm/indexes/base-index.js 784 B
packages/db/dist/esm/indexes/basic-index.js 2.17 kB
packages/db/dist/esm/indexes/btree-index.js 2.29 kB
packages/db/dist/esm/indexes/index-registry.js 820 B
packages/db/dist/esm/indexes/reverse-index.js 557 B
packages/db/dist/esm/live-query-adapter.js 318 B
packages/db/dist/esm/local-only.js 916 B
packages/db/dist/esm/local-storage.js 2.12 kB
packages/db/dist/esm/optimistic-action.js 359 B
packages/db/dist/esm/paced-mutations.js 496 B
packages/db/dist/esm/proxy.js 3.75 kB
packages/db/dist/esm/query/builder/functions.js 1.47 kB
packages/db/dist/esm/query/builder/index.js 5.84 kB
packages/db/dist/esm/query/builder/ref-proxy.js 1.24 kB
packages/db/dist/esm/query/compiler/evaluators.js 1.89 kB
packages/db/dist/esm/query/compiler/expressions.js 430 B
packages/db/dist/esm/query/compiler/group-by.js 3.56 kB
packages/db/dist/esm/query/compiler/index.js 6.67 kB
packages/db/dist/esm/query/compiler/joins.js 2.5 kB
packages/db/dist/esm/query/compiler/lazy-targets.js 923 B
packages/db/dist/esm/query/compiler/order-by.js 1.74 kB
packages/db/dist/esm/query/compiler/select.js 1.53 kB
packages/db/dist/esm/query/effect.js 4.77 kB
packages/db/dist/esm/query/expression-helpers.js 1.43 kB
packages/db/dist/esm/query/ir.js 1.25 kB
packages/db/dist/esm/query/live-query-collection.js 360 B
packages/db/dist/esm/query/live/collection-config-builder.js 9.1 kB
packages/db/dist/esm/query/live/collection-registry.js 264 B
packages/db/dist/esm/query/live/collection-subscriber.js 1.93 kB
packages/db/dist/esm/query/live/internal.js 145 B
packages/db/dist/esm/query/live/utils.js 1.81 kB
packages/db/dist/esm/query/optimizer.js 2.92 kB
packages/db/dist/esm/query/predicate-utils.js 2.97 kB
packages/db/dist/esm/query/query-once.js 359 B
packages/db/dist/esm/query/subset-dedupe.js 960 B
packages/db/dist/esm/scheduler.js 1.3 kB
packages/db/dist/esm/SortedMap.js 1.3 kB
packages/db/dist/esm/strategies/debounceStrategy.js 247 B
packages/db/dist/esm/strategies/queueStrategy.js 428 B
packages/db/dist/esm/strategies/throttleStrategy.js 246 B
packages/db/dist/esm/transactions.js 3.04 kB
packages/db/dist/esm/utils.js 927 B
packages/db/dist/esm/utils/array-utils.js 273 B
packages/db/dist/esm/utils/browser-polyfills.js 304 B
packages/db/dist/esm/utils/btree.js 5.61 kB
packages/db/dist/esm/utils/comparison.js 1.15 kB
packages/db/dist/esm/utils/cursor.js 457 B
packages/db/dist/esm/utils/index-optimization.js 2.39 kB
packages/db/dist/esm/utils/type-guards.js 157 B
packages/db/dist/esm/utils/uuid.js 449 B
packages/db/dist/esm/virtual-props.js 360 B

compressed-size-action::db-package-size

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 4.22 kB

ℹ️ View Unchanged
Filename Size
packages/react-db/dist/esm/index.js 249 B
packages/react-db/dist/esm/useLiveInfiniteQuery.js 1.32 kB
packages/react-db/dist/esm/useLiveQuery.js 1.33 kB
packages/react-db/dist/esm/useLiveQueryEffect.js 355 B
packages/react-db/dist/esm/useLiveSuspenseQuery.js 567 B
packages/react-db/dist/esm/usePacedMutations.js 401 B

compressed-size-action::react-db-package-size

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/db/skills/meta-framework/SKILL.md (1)

378-405: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the “Wrong” example actually demonstrate duplicate instances.

The shown route-local collection is a single stable instance shared by that loader and component, so it is not incorrect for one global QueryClient and business scope. Replace it with two separately created collections, or show a request/tenant-scoped client incorrectly reusing a process-global collection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/db/skills/meta-framework/SKILL.md` around lines 378 - 405, Update
the “Wrong” example in the collection-scope guidance to show two separately
created collection instances within the same QueryClient and business scope,
while keeping the “Correct” shared-module example and surrounding explanation
intact. Ensure the loader and component use different collection objects so the
duplicate-sync and split-state issue is actually demonstrated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/db/skills/db-core/custom-adapter/SKILL.md`:
- Around line 95-116: Define or clearly mark the waitForServerObservation helper
used by onInsert, onUpdate, and onDelete so the adapter example does not contain
an unresolved identifier. If implementing it, describe the provider/stream
observation mechanism and its completion behavior; otherwise label it as
pseudocode and provide guidance for replacing it with the target system’s
implementation.

In `@packages/react-db/skills/react-db/SKILL.md`:
- Around line 358-363: Update the InvalidSourceError example in the
query-builder alias troubleshooting section to match the current live-query
implementation, including the “Collection or subquery” wording and actionable
guidance, or paraphrase the complete message without preserving the outdated
incomplete quote.

---

Outside diff comments:
In `@packages/db/skills/meta-framework/SKILL.md`:
- Around line 378-405: Update the “Wrong” example in the collection-scope
guidance to show two separately created collection instances within the same
QueryClient and business scope, while keeping the “Correct” shared-module
example and surrounding explanation intact. Ensure the loader and component use
different collection objects so the duplicate-sync and split-state issue is
actually demonstrated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f8bc1da-8667-4fa5-9086-e4cff6d40f34

📥 Commits

Reviewing files that changed from the base of the PR and between 38682e4 and 39c8713.

📒 Files selected for processing (22)
  • .changeset/update-agent-skills.md
  • packages/angular-db/skills/angular-db/SKILL.md
  • packages/db/skills/db-core/SKILL.md
  • packages/db/skills/db-core/collection-setup/SKILL.md
  • packages/db/skills/db-core/collection-setup/references/electric-adapter.md
  • packages/db/skills/db-core/collection-setup/references/local-adapters.md
  • packages/db/skills/db-core/collection-setup/references/powersync-adapter.md
  • packages/db/skills/db-core/collection-setup/references/query-adapter.md
  • packages/db/skills/db-core/collection-setup/references/rxdb-adapter.md
  • packages/db/skills/db-core/collection-setup/references/trailbase-adapter.md
  • packages/db/skills/db-core/custom-adapter/SKILL.md
  • packages/db/skills/db-core/live-queries/SKILL.md
  • packages/db/skills/db-core/live-queries/references/operators.md
  • packages/db/skills/db-core/mutations-optimistic/SKILL.md
  • packages/db/skills/db-core/mutations-optimistic/references/transaction-api.md
  • packages/db/skills/db-core/persistence/SKILL.md
  • packages/db/skills/meta-framework/SKILL.md
  • packages/offline-transactions/skills/offline/SKILL.md
  • packages/react-db/skills/react-db/SKILL.md
  • packages/solid-db/skills/solid-db/SKILL.md
  • packages/svelte-db/skills/svelte-db/SKILL.md
  • packages/vue-db/skills/vue-db/SKILL.md

Comment on lines +95 to +116
const response = await fetch(config.endpoint, {
method: 'POST',
body: JSON.stringify(transaction.mutations[0].modified),
})
await waitForServerObservation(response)
},
onUpdate: async ({ transaction }) => {
const mut = transaction.mutations[0]
await fetch(`${config.endpoint}/${mut.key}`, {
const response = await fetch(`${config.endpoint}/${mut.key}`, {
method: 'PATCH',
body: JSON.stringify(mut.changes),
})
await waitForServerObservation(response)
},
onDelete: async ({ transaction }) => {
await fetch(`${config.endpoint}/${transaction.mutations[0].key}`, {
method: 'DELETE',
})
const response = await fetch(
`${config.endpoint}/${transaction.mutations[0].key}`,
{
method: 'DELETE',
},
)
await waitForServerObservation(response)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
git ls-files | grep -F 'packages/db/skills/db-core/custom-adapter/SKILL.md' || true

echo "== file size and relevant lines =="
if [ -f packages/db/skills/db-core/custom-adapter/SKILL.md ]; then
  wc -l packages/db/skills/db-core/custom-adapter/SKILL.md
  sed -n '1,140p' packages/db/skills/db-core/custom-adapter/SKILL.md | cat -n
fi

echo "== search helper usages/definitions =="
rg -n "waitForServerObservation|function waitForServerObservation|const waitForServerObservation|await waitForServerObservation" .

Repository: TanStack/db

Length of output: 5607


Define or clarify waitForServerObservation.

This helper is used in the onInsert, onUpdate, and onDelete examples but is not imported or defined, so copying the adapter code produces an unresolved identifier. Add an implementation for that provider/stream, or mark the helper as pseudocode with implementation guidance.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/db/skills/db-core/custom-adapter/SKILL.md` around lines 95 - 116,
Define or clearly mark the waitForServerObservation helper used by onInsert,
onUpdate, and onDelete so the adapter example does not contain an unresolved
identifier. If implementing it, describe the provider/stream observation
mechanism and its completion behavior; otherwise label it as pseudocode and
provide guidance for replacing it with the target system’s implementation.

Comment on lines +358 to +363
If a query-builder alias throws
`InvalidSourceError: The value provided for alias "todo" is not a Collection`,
it can mean two copies of `@tanstack/db` are installed. Direct
`useLiveQuery(preCreatedCollection)` detection is structural and works across
package copies or realms, but `q.from({ todo: collection })` still validates
the source with the core collection class.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the relevant source and documentation snippets.
git ls-files | rg '(^|/)SKILL\.md$|packages/db/src/errors\.ts$|invalidsource|InvalidSourceError' || true

echo '--- documentation snippet ---'
sed -n '345,370p' packages/react-db/skills/react-db/SKILL.md

echo '--- error implementation ---'
sed -n '360,400p' packages/db/src/errors.ts

echo '--- usages of InvalidSourceError messages ---'
rg -n "InvalidSourceError|not a Collection|subquery|source validation" packages || true

Repository: TanStack/db

Length of output: 46066


Synchronize the quoted InvalidSourceError message with the implementation.

InvalidSourceError now throws “Invalid source for live query: The value provided for alias "todo" is not a Collection or subquery...” and includes actionable guidance. Update the example to show the full message or paraphrase it so troubleshooting documentation doesn’t point users at an incomplete error text.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react-db/skills/react-db/SKILL.md` around lines 358 - 363, Update
the InvalidSourceError example in the query-builder alias troubleshooting
section to match the current live-query implementation, including the
“Collection or subquery” wording and actionable guidance, or paraphrase the
complete message without preserving the outdated incomplete quote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant