directus/rstore/rstore-monospace
Claude Code and agent skill by directus/rstore
- community
Checking that the SKILL.md file is still in the repository.
Use when integrating rstore with Monospace REST and OpenAPI helpers, generated Monospace collections, Monospace REST query options, primary key overrides, createMonospaceRestClient, createMonospaceRstorePlugin, createMonospaceQuery, and schema generation from remote or local OpenAPI documents; also use before writing custom Monospace REST CRUD around rstore collections.
Install
npx vskill@latest install directus/rstore/rstore-monospaceSKILL.md
Rstore Monospace
Use @rstore/monospace as the shared Monospace adapter layer for OpenAPI-generated rstore collections and REST-backed runtime CRUD behavior.
Core APIs
| Area | API | |
|---|---|---|
| Runtime client | createMonospaceRestClient({ url, workspace, apiKey?, fetch?, cacheControl? }) | |
| Runtime plugin | createMonospaceRstorePlugin({ url?, workspace?, apiKey?, cacheControl?, client?, scopeId? }) | |
| Query mapping | createMonospaceQuery(findOptions, overrides?) | |
| Query serialization | serializeMonospaceQuery(query) | |
| Mutation payloads | stripPrimaryKeys(item, primaryKeys), buildMonospaceRelationWrites | |
| Item keys | resolveMonospaceItemKey, resolveMonospaceKeyValues, createMonospaceKeysFilter | |
| Collection metadata | DEFAULT_MONOSPACE_SCOPE_ID, getMonospacePrimaryKeys, getMonospaceCollectionName | |
| Schema loading | loadMonospaceCollections({ url?, workspace?, schemaApiKey?, input?, metadataInput?, primaryKeys?, scopeId? }) | |
| Schema building | buildMonospaceCollections({ document, metadata, primaryKeys?, scopeId }) | |
| Code generation | generateCollectionsTemplate, generateItemsTemplate, generateTypedCollectionsTemplate, generateConfigTemplate, generateViteDeclarations |
Workflow
- Load the Monospace OpenAPI document and the schema metadata (schema structure endpoint) from a remote workspace or local JSON files.
- Generate rstore collections from
x-monospace-mappings,*CollectionOutputschemas, primary indexes, and FK constraints. - Create a runtime REST client with
createMonospaceRestClient. - Register
createMonospaceRstorePluginin the store plugins list. - Query and mutate through rstore collection APIs instead of component-level REST calls.
Schema Loading
- Generation requires both the OpenAPI document and the schema metadata (system meta collections:
MonospaceCollection,MonospacePrimitiveField,MonospaceSingleRelationField,MonospaceSingleConstraintField,MonospaceIndex,MonospaceIndexField). - Remote schema loading requires
urlandworkspace(projectis a deprecated alias). Metadata is read in oneGET /api/{workspace}/schema/structure/sourcesrequest with explicit fields (never*: it would select data source credentials) andlimit=-1on every to-many include. - Fully local loading uses
input(OpenAPI JSON) plusmetadataInput(metadata snapshot keyed by meta collection name) and can skip remote schema credentials.loadRemoteOpenApiDocument/loadRemoteSchemaMetadatareturn JSON ready to write as these snapshots. - Generated
meta.monospacecarriesitemRoutes: false(no/{key}routes),operations(only when some are not served, read from the OpenAPI path methods), andint64Fields(64-bit integers, typedstringsince responses return decimal strings). schemaApiKeyis only for build-time schema loading and needs theopenApiSchema:readanddataModel:readentitlements.- Primary keys come from each collection's primary index (ordered, composite supported);
primaryKeysis an override only, and a collection without a primary index and without an override fails generation. - Relations join on the real FK constraint columns (
onmaps target columns to source FK columns).
Runtime REST Behavior
- The runtime client calls endpoints under
/api/{workspace}/items/{collection}. - Supported item operations include read one, read many, create one, create many, update one, update many, delete one, and delete many.
- Bulk update and delete require a non-empty filter query.
- Primary key fields are stripped from update payloads before REST mutation calls.
- Create and update requests send
fields=*; Monospace returns no written item withoutfields. - Object keys (
{ a: 1, b: 2 }) use filtered collection requests (?filter[a][_eq]=1&filter[b][_eq]=2,limit=1on reads) because composite keys cannot go in the URL path. The plugin resolves composite keys and collections withmeta.monospace.itemRoutes: falseto object keys (cached item, then mutated item, then splitting the generateda::bkey);deleteManysends one filteredDELETE. - Create bodies never carry FK columns (Monospace create inputs reject them): to-one connects and FK column values become
{ relation: { _connect: { key } } }, null FK columns are omitted. Update bodies keep FK column writes. To-many operations are arrays in both modes. cacheControl: 'no-cache'sendsCache-Control: no-cacheto bypass the server-side read cache.- Monospace REST errors are mapped to typed errors (validation, auth, license
402, permission, not-found). The message appends the innermostsourcemessage to generic top-level messages,codeis the deepest code in thesourcechain, andMonospaceLicenseError.violationsexposesmeta.violations.
Query Behavior
- Pass Monospace REST query options in rstore find options:
fields,filter,sort,limit,offset, andparams. pageIndexandpageSizemap tooffsetandlimitwhen explicit pagination is not provided.createMonospaceQuerymerges adapterparams, top-level find options, and optional overrides.createMonospaceReadQuerybuilds read requests:fieldsdefaults to['*'](Monospace 1.0 rejects reads without a selection) and rstoreincludemaps to the Monospaceincludeparameter (include[author][fields]=*, nestedinclude[author][include][todos][fields]=*). To-many includes getlimit: -1so embedded lists are not truncated at 100 items.- Explicit
fieldsget the FK columns backing included relations appended; narrowed includefieldsget join and primary key columns. - Raw Monospace include options go in
params.includeand are deep-merged over the generated include (user values win). Filtered, paginated, or aliased includes always fetch. deepandaliasno longer exist in Monospace 1.0; aliases areresponseName:sourceFieldentries infields.sortis sent in the object formsort[0][field][direction]=desc;'field','-field', and{ field: 'desc' }are normalized to it.serializeMonospaceQueryconverts nested query options into URL search parameters, comma-joiningfieldsat every include level.
Guardrails
- Keep
schemaApiKeybuild/server-side; it is for OpenAPI loading. - Treat
runtimeApiKeyorapiKeyas emitted runtime/client code when configured. - Prefer the generated rstore plugin over ad hoc Monospace REST calls for generated collections.
- Use
rstore-vuefor query, live query, form, and cache semantics. - Use
rstore-vite-monospaceorrstore-nuxt-monospacefor framework wiring.
Security
- Security scanPassed, 91 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/monospace/skills/rstore-monospace/SKILL.md
Popularity
- Repository stars
- 433
- Repository forks
- 20
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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-monospace)