Skip to main content
data-client-setup 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 hands off to protocol-specific setup skills.
설치로 이동 Skills Marketplace 커뮤니티가 만든 AI 스킬을 발견하고 탐색하세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/reactive/data-client --skill data-client-setup명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Zip 다운로드 다운로드 중... Use @data-client/react hooks for data fetching, mutations, and rendering - useSuspense, useFetch, useQuery, useCache, useLive, useDLE, useSubscription, useController, DataProvider, AsyncBoundary, useLoading, useDebounce. Use when reading/rendering remote data, triggering mutations, doing optimistic updates, real-time subscriptions, or wiring Suspense/error boundaries in React.
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.
name data-client-setup description 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 hands off to protocol-specific setup skills. disable-model-invocation true
Setup Reactive Data Client
Detection Steps
Before installing, detect the project type and protocol by checking these files:
1. Detect Package Manager
Check which lock file exists:
yarn.lock → use yarn add
pnpm-lock.yaml → use pnpm add
package-lock.json or bun.lockb → use npm install or bun add
2. Detect Project Type
Check package.json dependencies:
Check Project Type "next" in dependenciesNextJS "expo" in dependenciesExpo "vue" in dependenciesVue "react-native" in dependencies (no expo)React Native "react" in dependencies
3. Detect Protocol Type Scan the codebase to determine which data-fetching protocols are used:
REST Detection
fetch() calls with REST-style URLs (/api/, /users/, etc.)
HTTP client libraries: axios, ky, got, superagent in package.json
Files with REST patterns: api.ts, client.ts, services/*.ts
URL patterns with path parameters: /users/:id, /posts/:postId/comments
HTTP methods in code: method: 'GET', method: 'POST', .get(, .post(
GraphQL Detection
@apollo/client, graphql-request, urql, graphql-tag in package.json
.graphql or .gql files in the project
`gql`` template literal tags
GraphQL query patterns: query {, mutation {, subscription {
GraphQL endpoint URLs: /graphql
Custom Protocol Detection For async operations that don't match REST or GraphQL:
Custom async functions returning Promises
Third-party SDK clients (Firebase, Supabase, AWS SDK, etc.)
IndexedDB or other local async storage
Installation
Core Packages Framework Core Package React (all) @data-client/react + dev: @data-client/testVue @data-client/vue (testing included)
Install Command Examples 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/test
npm install @data-client/vue
yarn add @data-client/vue
pnpm add @data-client/vue
Provider Setup After installing, add the provider at the top-level component.
NextJS (App Router) 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.
Expo import { Stack } from 'expo-router' ;
import { DataProvider } from '@data-client/react' ;
export default function RootLayout ( ) {
return (
<DataProvider >
<Stack >
<Stack.Screen name ="index" />
</Stack >
</DataProvider >
);
}
React Native 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 );
Plain React (Vite, CRA, etc.) Edit entry file (e.g., index.tsx, main.tsx, or src/index.tsx):
import { DataProvider } from '@data-client/react' ;
import ReactDOM from 'react-dom/client' ;
ReactDOM .createRoot (document .getElementById ('root' )!).render (
<DataProvider >
<App />
</DataProvider > ,
);
Vue import { createApp } from 'vue' ;
import { DataClientPlugin } from '@data-client/vue' ;
import App from './App.vue' ;
const app = createApp (App );
app.use (DataClientPlugin , {
});
app.mount ('#app' );
Protocol-Specific Setup After provider setup, apply the appropriate skill based on detected protocol:
REST APIs Apply skill "data-client-rest-setup" which will:
Install @data-client/rest
Offer to create a custom BaseEndpoint class extending RestEndpoint
Configure common behaviors: urlPrefix, authentication, error handling
GraphQL APIs Apply skill "data-client-graphql-setup" which will:
Install @data-client/graphql
Create and configure GQLEndpoint instance
Set up authentication headers
Custom Async Operations Apply skill "data-client-endpoint-setup" which will:
Install @data-client/endpoint
Offer to wrap existing async functions with new Endpoint()
Configure schemas and caching options
Multiple Protocols If multiple protocols are detected, apply multiple setup skills. Each protocol package can be installed alongside others.
Verification Checklist
Common Issues
NextJS: Wrong Import Path import { DataProvider } from '@data-client/react' ;
import { DataProvider } from '@data-client/react/nextjs' ;
Provider Not at Root The DataProvider must wrap all components that use data-client hooks. Place it at the topmost level possible.
Next Steps After core setup and protocol-specific setup:
Define data schemas using Entity - see skill "data-client-schema"
Use hooks like useSuspense, useQuery, useController - see skill "data-client-react" or "data-client-vue"
Define REST resources - see skill "data-client-rest"
References For detailed API documentation, see the references directory: