Agent skill

Data Client Schema

by reactive in reactive/data-client

Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization…

Apache-2.0Auto-check passedBackend & APIs

Install Data Client Schema

skills CLI
$ npx skills add reactive/data-client --skill data-client-schema -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install reactive/data-client data-client-schema --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/reactive/data-client.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/data-client-schema .claude/skills/data-client-schema && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
data-client-schema
GitHub stars
2k
Token cost
~2.3k tokens
SKILL.md length
750 words
Files
42 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization…

  • Works in 8 steps: Defining Schemas → Entity best practices → Entity lifecycle methods → …
  • Resource()/RestEndpoint schema
  • SKILL.md covers 1. Defining Schemas, 2. Entity best practices, 3. Entity lifecycle methods and 4. Union Types (Polymorphic…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Data Client Schema is an agent skill from reactive/data-client. Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization, identity-based caching, and a single source of truth. Use when defining or editing pk, static schema, resource()/RestEndpoint schema, mutable lists/maps (push/unshift/assign/remove/move), polymorphic/discriminated types, memoized selectors / derived data, partial/supplementary entities, relational/nested/joined data…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 42 other files, including reference files (for example `references.json`, `references/All.md` and `references/All.vue.md`).

It sits in Backend & APIs, covering Caching, Database schema design and GraphQL. It works with GraphQL. The repository describes itself as: Async State Management without the Management. REST, GraphQL, SSE, Websockets. The licence is Apache-2.0.

When your agent uses it

  • Resource()/RestEndpoint schema
  • Mutable lists/maps (push/unshift/assign/remove/move)
  • Polymorphic/discriminated types
  • Memoized selectors / derived data

Example prompts

  • “/data-client-schema”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Defining Schemas
  2. Entity best practices
  3. Entity lifecycle methods
  4. Union Types (Polymorphic Schemas)
  5. Collections (Mutable Lists & Maps)
  6. Supplementary Endpoints (enrich existing entities)
  7. Best Practices & Notes
  8. Common Mistakes to Avoid

What it can do on your machine

Read from SKILL.md and the folder at commit 02c0932. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • dataclient.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Data Client Schema loads about 2.3k tokens when it runs, and up to ~79k if it reads all its reference files. Until then it costs about 201 tokens; SKILL.md has 750 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~201
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~79k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from reactive/data-client at commit 02c0932, republished under its Apache-2.0 licence (© reactive). 750 words, ~2,332 tokens.

Download SKILL.mdSave it as .claude/skills/data-client-schema/SKILL.md (or your agent's skills folder). This skill also uses 41 other files; get the full folder from GitHub.
name
data-client-schema
description
Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization, identity-based caching, and a single source of truth. Use when defining or editing pk, static schema, resource()/RestEndpoint schema, mutable lists/maps (push/unshift/assign/remove/move), polymorphic/discriminated types, memoized selectors / derived data, partial/supplementary entities, relational/nested/joined data, optimistic updates, or cache invalidation across @data-client/rest, /endpoint, /graphql, or /normalizr. Apply proactively when discussing data models, remote data shape, caching, normalization, identity, joins, polymorphism, mutable collections, or store consistency.
license
Apache 2.0

1. Defining Schemas

Define schemas to represent the JSON returned by an endpoint. Compose these to represent the data expected.

Object
List
Map
  • new Collection(Values(Schema)) - mutable/growable maps
  • new Values(Schema) - immutable maps
Lens-dependent entity fields
Derived / selector pattern
  • new Query(Queryable) - memoized programmatic selectors

    ts
    const queryRemainingTodos = new Query(
      TodoResource.getList.schema,
      entries => entries.filter(todo => !todo.completed).length,
    );
    ts
    const groupTodoByUser = new Query(
      TodoResource.getList.schema,
      todos => Object.groupBy(todos, todo => todo.userId),
    );

    Define Query transformations with the data model (e.g. src/resources/) — not inside custom hooks wrapping useSuspense/useQuery, which hides data dependencies and couples data logic to view code.


2. Entity best practices

  • Every Entity subclass defines defaults for all non-optional serialised fields.
  • Override pk() only when the primary key ≠ id.
  • pk() return type is number | string | undefined
  • Override Entity.process(value, parent, key, args) to insert fields based on args/url
  • static schema (optional) for nested schemas or deserialization functions
    • When designing APIs, prefer nesting entities

3. Entity lifecycle methods

  • Normalize (JSON response → cache): operates on POJOs; output is JSON-serializable plain data stored in the normalized cache. Order: process() → pk() → validate() → visit nested schemas (recurse into schema fields) → if existing: mergeWithStore() which calls shouldUpdate() and maybe shouldReorder() + merge(); metadata via mergeMetaWithStore().
  • Denormalize (cache → component): creates Entity class instances via fromJS(), restoring prototype chain so getters, methods, and schema processing work. Order: createIfValid() → validate() → fromJS() → unvisit nested schemas (recurse into schema fields).

4. Union Types (Polymorphic Schemas)

To define polymorphic resources (e.g., events), use Union and a discriminator field.

typescript
import { Union } from '@data-client/rest'; // also available from @data-client/endpoint

export abstract class Event extends Entity {
  type: EventType = 'Issue';    // discriminator field is shared
  /* ... */
}
export class PullRequestEvent extends Event { /* ... */ }
export class IssuesEvent extends Event { /* ... */ }

export const EventResource = resource({
  path: '/users/:login/events/public/:id',
  schema: new Union(
    {
      PullRequestEvent,
      IssuesEvent,
      // ...other event types...
    },
    'type', // discriminator field
  ),
});

5. Collections (Mutable Lists & Maps)

Collections wrap Array or Values schemas to enable mutations (add/remove/move).

pk routing

pk() uses nestKey(parent, key) when nested in an Entity and available; otherwise it uses argsKey(...args), then serializes the result. Without options, it defaults to argsKey: params => ({ ...params }), using all endpoint args as the collection key.

  • argsKey — derive pk from endpoint arguments (default)
  • nestKey — derive pk from parent entity for nested shared-state collections

Define both on the same Collection to reuse one definition top-level and nested. When argsKey(args) and nestKey(parent) produce the same object shape, the top-level fetch and the nested read resolve to the same (referentially equal) array/map — push/unshift/assign/move/remove on either updates both:

ts
const userTodos = new Collection([Todo], {
  argsKey: ({ userId }: { userId?: string }) => ({ userId }),
  nestKey: (parent: User) => ({ userId: parent.id }),
});
nonFilterArgumentKeys

Default createCollectionFilter uses nonFilterArgumentKeys (default: keys starting with 'order') to exclude non-filter args when matching collections. This affects which existing collections receive new items from push/unshift/assign/move.

Override as function, RegExp, or string[]:

ts
new Collection([Todo], { nonFilterArgumentKeys: /orderBy|sortDir/ })
Show full SKILL.md (318 more words)Show less
Extenders

All usable with ctrl.set() (local-only) or via RestEndpoint extenders (network).

MethodTypeDescription
pushArrayEntity
unshiftArrayEntity
assignValuesMerge entries into map
removeBothRemove items by value from matching collections
moveBothRemove from collections matching existing state, add to collections matching new state
addWith(merge, filter?)BothCustom creation schema (used internally by push/unshift/assign)
moveWith(merge)BothCustom move schema (control insertion order, e.g., unshift merge for prepending)

6. Supplementary Endpoints (enrich existing entities)

When an endpoint returns partial or differently-shaped data for an entity already in cache (e.g., a metadata endpoint, a stats endpoint, a lazy-load expansion endpoint), use the same Entity as the schema — don't create a wrapper entity.

See partial-entities for patterns and examples.


7. Best Practices & Notes

  • Always set up schema on every resource/entity/collection for normalization
  • Normalize deeply nested or relational data by defining proper schemas
  • Use Entity.schema for client-side joins
  • Use Denormalize<> type from rest/endpoint/graphql instead of InstanceType<>. This will handle all schemas like Unions, not just Entity.

8. Common Mistakes to Avoid

  • The normalized cache stores plain JSON-serializable objects (POJOs), not class instances.
  • Don't forget to use fromJS() or assign default properties for class fields — bare TS field types emit no runtime defaults, so schema inference breaks
  • Manually merging or 'enriching' data; instead use Entity.schema for client-side joins

References

Vue projects: read <name>.vue.md instead of <name>.md when it exists.

For detailed API documentation, see the references directory:

© reactive, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 41 other files (references) in .agents/skills/data-client-schema of reactive/data-client.

  • SKILL.md
  • references.json
  • references/All.md
  • references/All.vue.md
  • references/Array.md
  • references/Array.vue.md
  • references/Collection.md
  • references/Collection.vue.md
  • references/Entity.md
  • references/Entity.vue.md
  • references/EntityMixin.md
  • references/EntityMixin.vue.md
  • references/Invalidate.md
  • references/Invalidate.vue.md
  • references/Lazy.md
  • references/Lazy.vue.md
  • references/Object.md
  • references/Object.vue.md
  • references/Query.md
  • references/Query.vue.md
  • … and 22 more

Open the folder on GitHubat commit 02c0932

Compare with similar skills

Data Client Schema next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Data Client Schema compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Data Client Schema this skillreactive/data-client2k—~2.3kAutomated safety check: PassApache-2.0
Wp Headless And Wpgraphqljorgerosal/wordpress-skills100—~1.7kAutomated safety check: PassMIT
API Architectcuriositech/some_claude_skills2431 repos~1.4kAutomated safety check: PassMIT
Apollo GraphqlKilo-Org/kilo-marketplace1891 repos~3.1kAutomated safety check: PassApache-2.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15817 repos~4kAutomated safety check: PassAGPL-3.0

Similar skills

  • Wp Headless And Wpgraphql

    jorgerosal/wordpress-skills

    Headless WordPress and WPGraphQL review guidance. An agent skill from jorgerosal/wordpress-skills.

    100 GitHub stars~1.7k tokensUpdated 4 mo ago
    Backend & APIsAuto-check passed
  • API Architect

    curiositech/some_claude_skills

    Expert API designer for REST, GraphQL, gRPC architectures. An agent skill from curiositech/some_claude_skills.

    243 GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check passed
  • Apollo Graphql

    Kilo-Org/kilo-marketplace

    Guidelines for developing GraphQL APIs and React applications using Apollo Client for state management, data fetching, and caching

    189 GitHub starsUsed in 1 repo~3.1k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 17 repos~4k tokens
    Backend & APIsAuto-check passed
  • Backend Endpoint

    qf-studio/navigator

    Create REST/GraphQL API endpoint with validation, error handling, and tests.

    354 GitHub starsUsed in 1 repo~4.5k tokens
    Backend & APIsAuto-check: notes

More from reactive/data-client

All 17 skills in this repo
  • Data Client REST Setup

    reactive/data-client

    Set up and migrate to @data-client/rest for REST APIs. An agent skill from reactive/data-client.

    2k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Data Client Manager

    reactive/data-client

    Implement @data-client Managers for global/background side effects - websocket, SSE, polling, real-time updates, subscriptions, logging, analytics, metrics/timing, error reporting (Sentry), toast…

    2k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Data Client React

    reactive/data-client

    Use @data-client/react hooks for data fetching, mutations, and rendering - useSuspense, useFetch, useQuery, useCache, useLive, useDLE, useSubscription, useController, DataProvider, AsyncBoundary…

    2k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Data Client React Testing

    reactive/data-client

    Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription…

    2k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Data Client REST

    reactive/data-client

    Define REST APIs with @data-client/rest - resource(), RestEndpoint, CRUD (GET/POST/PUT/PATCH/DELETE), HTTP fetch, normalize, cache, urlPrefix, path-to-regexp parameters, searchParams, pagination…

    2k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Data Client Vue

    reactive/data-client

    Use @data-client/vue composables for data fetching, mutations, and rendering - useSuspense, useFetch, useQuery, useCache, useLive, useDLE, useSubscription, useController, useLoading, useDebounce…

    2k GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Data Client Schema

What does Data Client Schema do?

Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization…. Data Client Schema is an agent skill from reactive/data-client. Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization, identity-based caching, and a single source of truth.

When should I use Data Client Schema?

Data Client Schema fits situations like: resource()/RestEndpoint schema; mutable lists/maps (push/unshift/assign/remove/move); polymorphic/discriminated types; memoized selectors / derived data.

How do I install Data Client Schema in Claude Code?

Run `npx skills add reactive/data-client --skill data-client-schema -a claude-code`. Or copy the skill folder (.agents/skills/data-client-schema in reactive/data-client) into .claude/skills/data-client-schema in your project. Claude Code loads it when a task matches its description.

How do I install Data Client Schema in Codex?

Run `npx skills add reactive/data-client --skill data-client-schema -a codex`. Or copy the skill folder (.agents/skills/data-client-schema in reactive/data-client) into .agents/skills/data-client-schema in your project. Codex loads it when a task matches its description.

Can I use Data Client Schema in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add reactive/data-client --skill data-client-schema -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/data-client-schema, .gemini/skills/data-client-schema, .github/skills/data-client-schema and .opencode/skills/data-client-schema in your project.

What does Data Client Schema need to run?

SKILL.md names no scripts, command-line tools or credentials: Data Client Schema is instructions for the agent only.

Does Data Client Schema access the network?

SKILL.md names 1 domain. As links in the text: dataclient.io. This is read from the text; nothing was executed.

Is Data Client Schema safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Data Client Schema use?

Data Client Schema is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Data Client Schema use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 76k tokens, read only when the agent opens those files.

What are the alternatives to Data Client Schema?

Skills that share tags, products or a category with Data Client Schema: Wp Headless And Wpgraphql (jorgerosal/wordpress-skills, 100 stars), API Architect (curiositech/some_claude_skills, 243 stars), Apollo Graphql (Kilo-Org/kilo-marketplace, 189 stars) and API Designer (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Data Client Schema?

reactive (a GitHub organization) maintains it in reactive/data-client, which has 2,037 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: reactive/data-client on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.