Epicenter workspace API patterns: `defineWorkspace`, `defineTable`, `defineKv`, table `.docs(...)`, migrations, actions, `connect(...)`, `mount(...)`, materializers, and lower-level `createWorkspace` / `openCollaboration` primitives. Use when editing workspace schemas, table/KV access, row child docs, actions, runtime connections, daemon mounts, or collaboration setup.
70
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Epicenter workspace definitions, table and KV access, isomorphic action registries, row child docs, runtime connection, daemon mount composition, and lower-level Y.Doc primitives share one model.
Notebook model:
defineWorkspace = pure app contract: id, name, tables, kv, actions, child-doc declarations
connect(...) = browser/local runtime: storage, optional relay sync, child-doc openers, wipe
mount(...) = daemon runtime: Yjs log, cloud sync, materializers, daemon actions
createWorkspace = low-level root Y.Doc bundle for internals, tests, and older ports
table.docs(...) = row child-doc declaration; callers open through tables.X.docs.field.open(rowId)When workspace behavior depends on Yjs transactions, shared types, update encoding, document lifecycle, or conflict semantics, use source-backed grounding before relying on memory. If DeepWiki MCP is available, ask a narrow question against yjs/yjs; for collaboration sync or awareness protocol behavior, ask against yjs/y-protocols. If DeepWiki is unavailable or the repo is not indexed, use upstream source or official docs directly. Treat DeepWiki as orientation, then verify decisive details against local workspace code, installed types, tests, or official docs before changing code.
Skip DeepWiki for Epicenter schema, action, migration, and attachment conventions already documented below.
yjs: Yjs CRDT patterns and shared typessvelte: reactive wrappers such as fromTable and fromKv, plus commit-on-blur workspace inputsattach-primitive: the full contract and invariants every attach* function must followtypebox: TypeBox primitives used by field.*, defineKv, and action input schemasdefineQuery / defineMutation factories are not Whispering $lib/rpc adapters from wellcrafted/query. Do not apply workspace action input-schema rules to Whispering RPC modules._v is library-managed. Never declare it as a column, never set it on a write, never read it off a row. Single-version tables drop the versioning surface entirely; multi-version tables expose it only inside the migrate function as ({ value, version }).field.* builders from @epicenter/field (field.string, field.number, field.boolean, field.select, field.json, field.datetime) plus the standalone nullable wrapper from @epicenter/workspace for the emptiness axis (an IANA timezone is just field.string<IanaTimeZone>(), no bespoke builder); raw Type.X() is allowed and the FlatJsonTSchema constraint enforces SQLite-mappable shapes either way.InferTableRow<typeof tableDefinition> in the same module that defines the table. Consumers import the type from the workspace definition module.defineKv(schema, defaultValue) where defaultValue is a factory () => Static<S>. Prefer one scalar per dot-namespaced key unless the value is a true atomic object.id and string foreign key uses a branded type plus a co-located generator. The brand lives as a pure type alias (type X = string & Brand<'X'>); the generator uses generateId<X>(). Call sites use the generator, never a direct cast.defineWorkspace({ id, name, tables, kv, actions }). The workspace file is the sync contract: schema, branded IDs, KV defaults, isomorphic actions, and table.docs(...) child-doc layouts.actions: ({ tables, kv, ydoc }) => defineActions({ ... }) callback. Runtime-specific actions live in connect(..., compose) or mount(..., compose), where browser, Node, Tauri, extension, materializer, or daemon APIs are in scope.workspaceDefinition.connect(null) for local-only browser storage and workspaceDefinition.connect(connection) for principal-scoped storage plus relay sync. Connected tables expose row child-doc openers at tables.X.docs.field.open(rowId).workspaceDefinition.mount(...) for daemon composition: Yjs-log persistence, cloud sync, materializers, and daemon-exposed actions.createWorkspace({ id, tables, kv }) as the lower-level root constructor for internals, tests, and older ports. It exposes { ydoc, tables, kv, actions, [Symbol.dispose] }; app-facing code normally starts from defineWorkspace.docGuid. The public contract is tables.X.docs.field.guid(rowId) and tables.X.docs.field.open(rowId).invokeAction, which validates input, wraps raw values in Ok, preserves
existing Results, and catches throws as Err(cause). Read the action return
reference before changing handler failure behavior.description field.client.ts, browser.ts, tauri.ts, or app-specific openers.defineWorkspace.connect(...). Avoid wrapper helpers that hide ordering unless the abstraction owns a real invariant.connectWorkspace() shortcut unless that API exists in the current package surface.defineTable, defineKv, row type inference, KV scalar design, and branded IDs.defineWorkspace actions, JSDoc, runtime action composition, file layout, attachment ordering, and script/daemon boundaries.tables.X.schema and schema.properties.X to compose defineQuery/defineMutation input schemas inline. No helper layer.invokeAction return contracts and error normalization.cb12bcc
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.