directus/rstore/rstore-vue
Claude Code and agent skill by directus/rstore
- community
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-vueSKILL.md
Rstore Vue
Build typed, cache-first Vue data flows with @rstore/vue, including core engine and shared contract behavior.
Documentation map
| Area | Documentation | |
|---|---|---|
| Getting started | https://rstore.akryum.dev/guide/getting-started#vue | |
| Collection schema | https://rstore.akryum.dev/guide/schema/collection | |
| Relations | https://rstore.akryum.dev/guide/schema/relations | |
| Query and live query | https://rstore.akryum.dev/guide/data/query, https://rstore.akryum.dev/guide/data/live | |
| Mutations and forms | https://rstore.akryum.dev/guide/data/mutation, https://rstore.akryum.dev/guide/data/form | |
| Cache and modules | https://rstore.akryum.dev/guide/data/cache, https://rstore.akryum.dev/guide/data/module | |
| Plugin setup and hooks | https://rstore.akryum.dev/guide/plugin/setup, https://rstore.akryum.dev/guide/plugin/hooks | |
| Skill-local API references | ./references/index.md |
Core concepts
| Primitive | Purpose | |
|---|---|---|
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 / setActiveStore | Injects store into Vue or non-component/test contexts | |
store.<collection> and store.$collection(name) | Entry point for read/write/query/form operations | |
query / liveQuery | Reactive queries with loading/error/meta/pagination semantics | |
realtimeReconnectEventHook | Shared reconnect signal used by realtime transports; liveQuery refreshes when it fires | |
useQueryTracking | Tracks query membership and filters dirty cached items in reactive flows | |
createForm / updateForm / createFormObject | Mutation 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 primitives | Backing implementation for collection/schema, find/peek/mutation/subscription behavior | |
@rstore/shared types + hooks | Cross-package contracts for options, meta, payloads, and utilities |
Quick start
Task workflow
- Define collections and relations first.
- Create a store with
createStore({ schema, plugins }). - Install
RstorePluginin app code or setsetActiveStore(store)in tests/non-injection contexts. - Use collection APIs (
find*,query,liveQuery) instead of custom fetch refs. - Use
createForm/updateFormfor mutation UIs andcreateFormObjectfor custom flows. - Move transport/data-source behavior into
definePluginhooks, not component-level code. - 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
| API | Use it for | |
|---|---|---|
peekFirst / peekMany | Cache-only reads for computed/reactive derivations | |
findFirst / findMany | One-shot async reads without long-lived query refs | |
query | Reactive ref-based queries (data, loading, error, foreground, background, refresh) | |
liveQuery | Query + subscription lifecycle for realtime adapters | |
fetchMore | Adds page results to sparse pages and merged data | |
createForm / updateForm | Preferred mutation UX; updateForm can prefetch item and send changed fields only | |
createFormObject | Lower-level custom form builder with schema validation and hooks |
Notes:
createFormObjectsupportsvalidateOnSubmit,transformData,resetOnSuccess,$changedProps, and$valid.- Form objects expose
$opLogfor undo/redo and optimized form operations. - Use
$rebase,$conflicts, and$resolveConflictfor collaborative editing flows. $save()and$onSaved()are deprecated compatibility aliases. Prefer$submit()and$onSuccess().- Query
confirmedis a readonly ref: all existing pages must have server-confirmed results for current options. Each page exposes readonlyconfirmed. Fetches and published pushes confirm; cache guesses do not. Option changes, cache resets and$cache.clearCollectionclear 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. Plainsubscribe()has noend,refreshorsetResultcallbacks. - Subscription identity uses resolved reads after defaults/hooks; client-only controls do not reopen plain or live subscriptions. See
references/api-subscribe.mdfor resolved payload, key and teardown contracts.
Modules and plugins
defineModule(name, cb)caches module instances instore.$modulesCache.defineModulerequires 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.$resultVersionand pushsetResult(rows, { version })(FieldTimestampValue, finite number or serialized HLC;setResultthrows for other formats). A versioned push drops an unversioned fetch already in flight.setResultreturns'applied'when accepted (non-main pages queue it and can still drop it),'stale'or'inactive'; itsmetaexcludes 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-rowfieldTimestampsthroughsetResult(array index matches row index; equal lengths required, development warning on mismatch);no-cache, stale, inactive and dropped queued pushes never write shared cache. realtimeReconnectEventHookshould be triggered by realtime plugins only after transport recovery;liveQueryrefreshes 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
- Calling
useStore()without installation/active store throws. defineModuleoutside setup without an available store throws.- Query
no-cacheandcache-*behaviors differ materially; align changes with the documented query fetch-policy behavior. experimentalGarbageCollectionaffects query tracking behavior; use only with explicit coverage.- Dynamic
store.$collection(name)calls throw for unknown collection names. - 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
- SKILL.md in the repositoryCheckingpackages/vue/skills/rstore-vue/SKILL.md
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
[](https://verified-skill.com/skills/directus/rstore/rstore-vue)