Install and set up @data-client/react or @data-client/vue in a project. Detects project type (NextJS, Expo, React Native, Vue, plain React) and protocol (REST, GraphQL, custom), then follows the bundled protocol-specific setup guide.
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Before installing anything, tell the user which packages and skills you'll add. A request to add or set up Data Client is the go-ahead; otherwise wait for theirs.
Before installing, detect the project type and protocol by checking these files:
Check which lock file exists:
yarn.lock → use yarn addpnpm-lock.yaml → use pnpm addpackage-lock.json or bun.lockb → use npm install or bun addCheck package.json dependencies:
| Check | Project Type |
|---|---|
"next" in dependencies | NextJS |
"expo" in dependencies | Expo |
"vue" in dependencies | Vue |
"react-native" in dependencies (no expo) | React Native |
"react" in dependencies | Plain React |
Scan the codebase to determine which data-fetching protocols are used:
Look for these patterns:
fetch() calls with REST-style URLs (/api/, /users/, etc.)axios, ky, got, superagent in package.jsonapi.ts, client.ts, services/*.ts/users/:id, /posts/:postId/commentsmethod: 'GET', method: 'POST', .get(, .post(Look for these patterns:
@apollo/client, graphql-request, urql, graphql-tag in package.json.graphql or .gql files in the projectquery {, mutation {, subscription {/graphqlFor async operations that don't match REST or GraphQL:
Check package.json | Then |
|---|---|
@tanstack/react-query or react-query (React) | After setup, migrate per Replacing TanStack Query |
Protocol setup guides are bundled in this skill, but defining and using data afterwards is covered by other Data Client skills. Install the ones that match what you detected, skipping any already installed:
| Detected | Skills |
|---|---|
| Always | data-client-schema, data-client-manager |
| React (NextJS, Expo, React Native, plain React) | data-client-react, data-client-react-testing |
| Vue | data-client-vue, data-client-vue-testing |
| REST | data-client-rest |
| GraphQL | None beyond Always (data-client-schema covers @data-client/graphql) |
| Custom async | None beyond Always (data-client-schema covers @data-client/endpoint) |
In Claude Code, Cursor and Codex, install nothing now: each skill ships inside the @data-client/* package it covers, at that package's version. After installing the packages below, link their skills from the project root. It links them into .agents/skills and makes sure .claude/skills sees them too, whichever of the two folders the project already has:
npx --no data-client-skills # pnpm exec data-client-skills, yarn data-client-skillsIf it reports Kept .agents/skills/data-client-setup, that's the copy the skills CLI installed to start this setup.
Remove it with npx skills remove data-client-setup -y and run the command again, so this skill too follows the
installed version.
If the command isn't found, or reports that a package ships no skills, the installed packages predate 0.19: install
the skills with the skills CLI as described below for other agents, and leave the last sentence (the data-client-skills command) out of the AGENTS.md lines.
Then add these lines to the project's AGENTS.md (create it if missing), using the project's package manager in the command. They tell later agents that Data Client owns the app's server state, so they reach for it and its skills instead of hand-written fetching, and keep the skill links current. Claude Code reads AGENTS.md only when the project has no CLAUDE.md, so if a CLAUDE.md exists, make sure it has an @AGENTS.md line. Commit .agents/skills and .claude/skills with the setup.
This app manages server state (fetching, caching, mutations and real-time updates) with Reactive Data Client. Use it for all server data, and read the matching `data-client-*` skill before writing, changing or debugging code that loads or changes data. After adding, removing or upgrading `@data-client/*` packages, run `npx --no data-client-skills` and commit the skill links.For other agents, use the installer that installed this skill. For OpenSkills and the skills CLI, add -g if this skill lives under your home directory rather than the project.
AGENTS.md lists skills in an <available_skills> block): npx openskills install reactive/data-client/.agents/skills/<skill>, once per skill.npx skills add reactive/data-client --skill <skill> --skill <skill> ...Skills linked during a session may not load until the next one (Claude Code only picks them up live from a .claude/skills folder that existed when the session started, and Cursor fixes its skill list when a chat starts). So for the rest of this session, whenever a task calls for one of them, here or after setup, read its SKILL.md directly (.claude/skills/<skill>/SKILL.md after linking) unless it's already available by name. The next session loads them on its own.
| Framework | Core Package |
|---|---|
| React (all) | @data-client/react + dev: @data-client/test |
| Vue | @data-client/vue (testing included) |
React (NextJS, Expo, React Native, plain React):
npm install @data-client/react && npm install -D @data-client/test
yarn add @data-client/react && yarn add -D @data-client/test
pnpm add @data-client/react && pnpm add -D @data-client/testVue:
npm install @data-client/vue
yarn add @data-client/vue
pnpm add @data-client/vueAfter installing, put the provider at the root, outside every other provider and boundary, not where the replaced
library's provider was. React's DataProvider has a backup <Suspense>, so a Suspense boundary above it never catches.
Edit app/layout.tsx:
import { DataProvider } from '@data-client/react/nextjs';
export default function RootLayout({ children }) {
return (
<html>
<DataProvider>
<body>
{children}
</body>
</DataProvider>
</html>
);
}Important: NextJS uses @data-client/react/nextjs import path.
Edit app/_layout.tsx:
import { Stack } from 'expo-router';
import { DataProvider } from '@data-client/react';
export default function RootLayout() {
return (
<DataProvider>
<Stack>
<Stack.Screen name="index" />
</Stack>
</DataProvider>
);
}Edit entry file (e.g., index.tsx):
import { DataProvider } from '@data-client/react';
import { AppRegistry } from 'react-native';
const Root = () => (
<DataProvider>
<App />
</DataProvider>
);
AppRegistry.registerComponent('MyApp', () => Root);Edit entry file (e.g., index.tsx, main.tsx, or src/index.tsx):
import { AsyncBoundary, DataProvider } from '@data-client/react';
import { createRoot } from 'react-dom/client';
createRoot(document.getElementById('root')!).render(
<DataProvider>
<AsyncBoundary fallback={<Spinner />}>
<App />
</AsyncBoundary>
</DataProvider>,
);Edit main.ts:
import { createApp } from 'vue';
import { DataClientPlugin } from '@data-client/vue';
import App from './App.vue';
const app = createApp(App);
app.use(DataClientPlugin, {
// optional overrides
// managers: getDefaultManagers,
// initialState,
// Controller,
// gcPolicy,
});
app.mount('#app');After provider setup, follow the guide for each detected protocol. These guides are bundled copies of the standalone protocol setup skills, so they need nothing else installed.
Follow references/data-client-rest-setup.md, which will:
@data-client/restBaseEndpoint class extending RestEndpointFollow references/data-client-graphql-setup.md, which will:
@data-client/graphqlGQLEndpoint instanceFollow references/data-client-endpoint-setup.md, which will:
@data-client/endpointnew Endpoint()If multiple protocols are detected, follow each protocol's guide. Each protocol package can be installed alongside others.
When a React app uses TanStack Query, a request to set up or migrate to Data Client includes replacing it: follow
TanStack Query migration from its "Steps" section. Its step 1 is
the protocol guide above, so the REST guide's "leave how the app loads and stores data alone" does not apply here. Look up each
TanStack Query API in its "API map" rather than working out a replacement, and finish with its "Check the migration"
list. Libraries built on TanStack Query, like react-query-auth, are replaced in the same pass.
Data Client's own useQuery reads the store and never fetches, so it is not the replacement for TanStack Query's
useQuery: that is useSuspense (or useDLE).
The guide is React only. For a Vue app on @tanstack/vue-query, tell the user this skill has no Vue migration guide
yet, and finish setup without replacing it.
After setup, verify:
package.json@data-client/react/nextjs for NextJS)❌ Wrong:
import { DataProvider } from '@data-client/react';✅ Correct for NextJS:
import { DataProvider } from '@data-client/react/nextjs';After core setup and protocol-specific setup (in this session, read each skill below from .claude/skills/<skill>/SKILL.md):
Entity - see skill "data-client-schema"useSuspense, useQuery, useController - see skill "data-client-react" or "data-client-vue"Vue projects: read <name>.vue.md instead of <name>.md when it exists.
For detailed API documentation, see the references directory:
DataClientPlugin instead; see installation)@data-client/rest setup and migration from axios, fetch, ky, superagent or got@data-client/graphql setup@data-client/endpointuseQuery, useMutation, query invalidation and QueryClient (React)reactive/data-client
e1ea9ce
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.