directus/rstore/rstore-vue

Claude Code and agent skill by directus/rstore

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when handling app data in Vue with `@rstore/vue` — fetch items/lists, keep queries reactive or live, create/update/delete records with forms, manage cache consistency, and debug store/query/subscription behavior across collections; also use before writing a custom fetch composable, ad hoc fetch ref, or bespoke cache layer for collection data — prefer `find*`, `query`, `liveQuery`, `createForm`, and `definePlugin` hooks over hand-rolled fetching/caching.

Install

npx vskill@latest install directus/rstore/rstore-vue

SKILL.md

Rstore Vue

Build typed, cache-first Vue data flows with @rstore/vue, including core engine and shared contract behavior.

Documentation map

AreaDocumentation
Getting startedhttps://rstore.akryum.dev/guide/getting-started#vue
Collection schemahttps://rstore.akryum.dev/guide/schema/collection
Relationshttps://rstore.akryum.dev/guide/schema/relations
Query and live queryhttps://rstore.akryum.dev/guide/data/query, https://rstore.akryum.dev/guide/data/live
Mutations and formshttps://rstore.akryum.dev/guide/data/mutation, https://rstore.akryum.dev/guide/data/form
Cache and moduleshttps://rstore.akryum.dev/guide/data/cache, https://rstore.akryum.dev/guide/data/module
Plugin setup and hookshttps://rstore.akryum.dev/guide/plugin/setup, https://rstore.akryum.dev/guide/plugin/hooks
Skill-local API references./references/index.md

Core concepts

PrimitivePurpose
withItemType(...).defineCollection(...)Defines a typed collection contract before using it in components
defineRelations(...)Defines normalized cross-collection relations once
addCollectionRelations(store, relations)Adds relation blocks after store creation when schema is composed dynamically
createStore({ schema, plugins, ... })Builds store core, cache, hook system, and per-collection API proxies
RstorePlugin / setActiveStoreInjects store into Vue or non-component/test contexts
store.<collection> and store.$collection(name)Entry point for read/write/query/form operations
query / liveQueryReactive queries with loading/error/meta/pagination semantics
realtimeReconnectEventHookShared reconnect signal used by realtime transports; liveQuery refreshes when it fires
useQueryTrackingTracks query membership and filters dirty cached items in reactive flows
createForm / updateForm / createFormObjectMutation and validation workflow with submit/reset/change tracking
definePlugin({ ... })Extends fetch/cache/mutation/subscribe/sync behavior via hooks
defineModule(name, cb)Creates store-scoped reusable logic with per-store caching
@rstore/core primitivesBacking implementation for collection/schema, find/peek/mutation/subscription behavior
@rstore/shared types + hooksCross-package contracts for options, meta, payloads, and utilities

Quick start

ts
import { createStore, RstorePlugin, withItemType } from '@rstore/vue'
export const todos = withItemType<Todo>().defineCollection({
name: 'todos',
})
const store = await createStore({
schema: [todos],
plugins: [],
})
app.use(RstorePlugin, { store })

Task workflow

  1. Define collections and relations first.
  2. Create a store with createStore({ schema, plugins }).
  3. Install RstorePlugin in app code or set setActiveStore(store) in tests/non-injection contexts.
  4. Use collection APIs (find*, query, liveQuery) instead of custom fetch refs.
  5. Use createForm/updateForm for mutation UIs and createFormObject for custom flows.
  6. Move transport/data-source behavior into definePlugin hooks, not component-level code.
  7. When behavior is unclear, check docs and skill references first; if docs are incomplete or wrong, fix docs before updating this skill.

Query and form guidance

APIUse it for
peekFirst / peekManyCache-only reads for computed/reactive derivations
findFirst / findManyOne-shot async reads without long-lived query refs
queryReactive ref-based queries (data, loading, error, foreground, background, refresh)
liveQueryQuery + subscription lifecycle for realtime adapters
fetchMoreAdds page results to sparse pages and merged data
createForm / updateFormPreferred mutation UX; updateForm can prefetch item and send changed fields only
createFormObjectLower-level custom form builder with schema validation and hooks

Notes:

  • createFormObject supports validateOnSubmit, transformData, resetOnSuccess, $changedProps, and $valid.
  • Form objects expose $opLog for undo/redo and optimized form operations.
  • Use $rebase, $conflicts, and $resolveConflict for collaborative editing flows.
  • $save() and $onSaved() are deprecated compatibility aliases. Prefer $submit() and $onSuccess().
  • Query confirmed is a readonly ref: all existing pages must have server-confirmed results for current options. Each page exposes readonly confirmed. Fetches and published pushes confirm; cache guesses do not. Option changes, cache resets and $cache.clearCollection clear it; local writes preserve it. Saved refs retain confirmation across remounts and SSR hydration. See api-query.
  • Function-valued options (such as filter) do not identify a query, page or subscription: function-only changes reload pages in place and never resubscribe.
  • Live-query connectors report server termination with end({ reason, retry }); accepted results renew recovery budget, while immediate kickout loops stay bounded. Plain subscribe() has no end, refresh or setResult callbacks.
  • Subscription identity uses resolved reads after defaults/hooks; client-only controls do not reopen plain or live subscriptions. See references/api-subscribe.md for resolved payload, key and teardown contracts.

Modules and plugins

  • defineModule(name, cb) caches module instances in store.$modulesCache.
  • defineModule requires injection context or an explicit/active store.
  • definePlugin({ name, category, scopeId?, setup }) is the extension point for fetch/cache/mutation/subscription/sync hooks.
  • For live pagination, use liveQuery(builder, { pages: () => [current.value] }) for displayed pages or { pages: 'all' } for every existing page. Default follows the main page. Offset windows can shift relative to each other; keeping several displayed pages consistent is not supported yet.
  • Connectors order snapshots with fetch meta.$resultVersion and push setResult(rows, { version }) (FieldTimestampValue, finite number or serialized HLC; setResult throws for other formats). A versioned push drops an unversioned fetch already in flight. setResult returns 'applied' when accepted (non-main pages queue it and can still drop it), 'stale' or 'inactive'; its meta excludes reserved $ fields. Older page versions are rejected; equal versions apply. Refresh retains versions; base option changes reset them. Accepted pushed rows are cloned, parsed and written through the fetch pipeline; connectors must pass raw rows without pre-writing them. No-cache pushes expose wrapped item API, computed fields and relations. Pushed cache writes release relevant absence in other queries; local computed membership changes retain ownership like fetched rows until replacement/disposal. Pass shared or per-row fieldTimestamps through setResult (array index matches row index; equal lengths required, development warning on mismatch); no-cache, stale, inactive and dropped queued pushes never write shared cache.
  • realtimeReconnectEventHook should be triggered by realtime plugins only after transport recovery; liveQuery refreshes automatically when it fires.
  • addCollectionDefaults(...) is the right place for shared field parsing/default behavior.
  • Keep plugin behavior keyed by store/scope instead of global mutable state.

Guardrails

  1. Calling useStore() without installation/active store throws.
  2. defineModule outside setup without an available store throws.
  3. Query no-cache and cache-* behaviors differ materially; align changes with the documented query fetch-policy behavior.
  4. experimentalGarbageCollection affects query tracking behavior; use only with explicit coverage.
  5. Dynamic store.$collection(name) calls throw for unknown collection names.
  6. Avoid duplicating entity state outside store cache unless intentionally divergent.

References

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 96 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
413
Repository forks
17
7-day trend score
30

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 25 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/directus/rstore/rstore-vue/badge)](https://verified-skill.com/skills/directus/rstore/rstore-vue)

Something wrong with this skill or its page? Tell us.