Agent skill

Data Client REST Setup

by reactive in reactive/data-client

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

Apache-2.0Auto-check passedBackend & APIs

Install Data Client REST Setup

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

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

GitHub CLI
$ gh skill install reactive/data-client data-client-rest-setup --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-rest-setup .claude/skills/data-client-rest-setup && 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-rest-setup
GitHub stars
2k
Token cost
~2.9k tokens
SKILL.md length
842 words
Files
17 (incl. scripts, references)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

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

  • Works in 3 steps: Installation → Detect Existing HTTP Patterns → Custom RestEndpoint Base Class
  • Adopting @data-client/rest in a new
  • SKILL.md covers Step 1: Installation, Step 2: Detect Existing HTTP…, Migration References and Step 3: Custom RestEndpoint…, plus 5 more sections
  • Runs JavaScript scripts from its folder; calls npm, yarn and pnpm

What it does

Data Client REST Setup is an agent skill from reactive/data-client. Set up and migrate to @data-client/rest for REST APIs. Detects existing HTTP patterns (axios, fetch, ky, superagent, got) and migrates them. Creates custom RestEndpoint base class with common behaviors. Use when adopting @data-client/rest in a new or existing project.

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

It sits in Backend & APIs, covering REST APIs. 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

  • Adopting @data-client/rest in a new
  • Existing project

Example prompts

  • “/data-client-rest-setup”

Requirements

  • Node.js

Workflow steps

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

  1. Installation
  2. Detect Existing HTTP Patterns
  3. Custom RestEndpoint Base Class

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

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • npm
    • yarn
    • pnpm
    • npx

    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 REST Setup loads about 2.9k tokens when it runs, and up to ~57k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 842 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

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

Download SKILL.mdSave it as .claude/skills/data-client-rest-setup/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
data-client-rest-setup
description
Set up and migrate to @data-client/rest for REST APIs. Detects existing HTTP patterns (axios, fetch, ky, superagent, got) and migrates them. Creates custom RestEndpoint base class with common behaviors. Use when adopting @data-client/rest in a new or existing project.
disable-model-invocation
true

REST Protocol Setup & Migration

This guide configures @data-client/rest for a project. It handles both fresh setup and migration from existing HTTP libraries. Use it once the Data Client provider is set up and the project calls REST APIs.

The RestEndpoint and resource references cover the APIs this guide uses. If the skill "data-client-rest" is installed, also apply it for resource and endpoint patterns beyond setup.

Step 1: Installation

Install the REST package alongside the core package:

bash
# npm
npm install @data-client/rest

# yarn
yarn add @data-client/rest

# pnpm
pnpm add @data-client/rest

Step 2: Detect Existing HTTP Patterns

Scan the codebase to determine what's currently used. Multiple patterns may coexist — run each applicable migration sub-procedure independently on the relevant files.

Detection Checklist

Check package.json dependencies and scan source files:

CheckPatternAction
"axios" in dependencies, or import.*from ['"]axios['"] in sourceAxiosFollow references/axios-migration.md
fetch( calls with REST-style URLs, or wrapper functions around fetchRaw fetchFollow references/fetch-migration.md
"ky" in dependencies, or import.*from ['"]ky['"]KyFollow references/ky-migration.md
"superagent" in dependenciesSuperAgentFollow references/superagent-migration.md
"got" in dependencies (rare in browser code)GotFollow references/got-migration.md
No existing HTTP library detectedFresh projectSkip to Step 3: Custom RestEndpoint Base Class
Ambiguous Detection

If you cannot confidently determine which patterns are used (e.g., no clear imports but HTTP calls exist), ask the user:

I found HTTP calls in your codebase but couldn't determine the library. Are you migrating from:

  1. axios
  2. Raw fetch / custom fetch wrapper
  3. ky
  4. superagent
  5. Something else (please describe)
  6. Starting fresh (no migration needed)
Mixed Codebases

When multiple HTTP libraries are detected, run each sub-procedure on the relevant files. The sub-procedures are independent and don't conflict:

  1. Identify which files use which library (group by import statements)
  2. Run each applicable migration sub-procedure on its file group
  3. After all migrations, proceed to the base class setup

Migration References

Each migration is a self-contained reference. Read only the relevant one(s) based on detection results above. After completing migrations, return here for base class setup.

Step 3: Custom RestEndpoint Base Class

After installation and any migrations, offer to create a custom RestEndpoint class for the project.

Detection Checklist

Scan the existing codebase for common REST patterns to include:

  1. Base URL / API prefix: Look for hardcoded URLs like https://api.example.com or env vars like process.env.API_URL
  2. Authentication: Look for Authorization headers, tokens in localStorage/cookies, auth interceptors
  3. Content-Type handling: Check if API uses JSON, form-data, or custom content types
  4. Error handling: Look for error response patterns, status code handling
  5. Request/Response transforms: Data transformations, date parsing, case conversion
  6. Query string format: Simple params vs nested objects (may need qs library)
Show full SKILL.md (342 more words)Show less
Base Class Template

Create a file at src/api/BaseEndpoint.ts (or similar location based on project structure):

ts
import { RestEndpoint, RestGenerics } from '@data-client/rest';

/**
 * Base RestEndpoint with project-specific defaults.
 * Extend this for all REST API endpoints.
 */
export class BaseEndpoint<O extends RestGenerics = any> extends RestEndpoint<O> {
  // API base URL - adjust based on detected patterns
  urlPrefix = process.env.REACT_APP_API_URL ?? 'https://api.example.com';

  // Add authentication headers
  getHeaders(headers: HeadersInit): HeadersInit {
    const token = localStorage.getItem('authToken');
    return {
      ...headers,
      ...(token && { Authorization: `Bearer ${token}` }),
    };
  }
}

Common Lifecycle Overrides

Include these based on what's detected in the codebase. See RestEndpoint for full API documentation.

Authentication (async token refresh)
ts
async getHeaders(headers: HeadersInit): Promise<HeadersInit> {
  const token = await getValidToken(); // handles refresh
  return {
    ...headers,
    Authorization: `Bearer ${token}`,
  };
}
Authentication from React context (Okta, Auth0)

When auth tokens live in React context (not localStorage), getHeaders() on a base class cannot access them. Use hookifyResource() to inject context-derived headers into every endpoint:

ts
import { hookifyResource, resource } from '@data-client/rest';

const ArticleResourceBase = resource({
  path: '/articles/:id',
  schema: Article,
  Endpoint: BaseEndpoint,
});

export const ArticleResource = hookifyResource(
  ArticleResourceBase,
  function useInit() {
    const accessToken = useContext(AuthContext);
    return {
      headers: { Authorization: `Bearer ${accessToken}` },
    };
  },
);

Usage: useSuspense(ArticleResource.useGet(), { id }) — the hook calls useInit() on every render, so the token is always fresh from context.

Custom Request Init (CSRF, credentials)
ts
getRequestInit(body?: RequestInit['body'] | Record<string, unknown>): RequestInit {
  return {
    ...super.getRequestInit(body),
    credentials: 'include', // for cookies
    headers: {
      'X-CSRF-Token': getCsrfToken(),
    },
  };
}
Custom Response Parsing (unwrap data envelope)
ts
process(value: any, ...args: any[]) {
  // If API wraps responses in { data: ... }
  return value.data ?? value;
}
Custom Error Handling
ts
async fetchResponse(input: RequestInfo, init: RequestInit): Promise<Response> {
  const response = await super.fetchResponse(input, init);
  
  if (response.status === 401) {
    window.dispatchEvent(new CustomEvent('auth:expired'));
  }
  
  return response;
}
Custom Search Params (using qs library)
ts
searchToString(searchParams: Record<string, any>): string {
  return qs.stringify(searchParams, { arrayFormat: 'brackets' });
}
Custom parseResponse (handle non-JSON)
ts
async parseResponse(response: Response): Promise<any> {
  const contentType = response.headers.get('content-type');
  
  if (contentType?.includes('text/csv')) {
    return parseCSV(await response.text());
  }
  
  return super.parseResponse(response);
}

Full Example with Multiple Overrides

ts
import { RestEndpoint, RestGenerics } from '@data-client/rest';
import qs from 'qs';

export class BaseEndpoint<O extends RestGenerics = any> extends RestEndpoint<O> {
  urlPrefix = process.env.API_URL ?? 'http://localhost:3001/api';

  async getHeaders(headers: HeadersInit): Promise<HeadersInit> {
    const token = await getAuthToken();
    return {
      ...headers,
      'Content-Type': 'application/json',
      ...(token && { Authorization: `Bearer ${token}` }),
    };
  }

  getRequestInit(body?: RequestInit['body'] | Record<string, unknown>): RequestInit {
    return {
      ...super.getRequestInit(body),
      credentials: 'include',
    };
  }

  searchToString(searchParams: Record<string, any>): string {
    return qs.stringify(searchParams, { arrayFormat: 'brackets' });
  }

  process(value: any, ...args: any[]) {
    return value?.data ?? value;
  }
}

async function getAuthToken(): Promise<string | null> {
  return localStorage.getItem('token');
}

Usage After Setup

Once the base class is created, use it instead of RestEndpoint directly.

Choosing resource() vs individual endpoints

Use resource() when an API module has standard CRUD on a single path (list, get, create, update, delete). This is the common case:

ts
import { resource } from '@data-client/rest';
import { BaseEndpoint } from './BaseEndpoint';
import { Todo } from '../schemas/Todo';

export const TodoResource = resource({
  path: '/todos/:id',
  schema: Todo,
  Endpoint: BaseEndpoint,
});
// Provides: TodoResource.get, .getList, .create, .update, .delete, .partialUpdate

Use standalone new BaseEndpoint() for non-CRUD operations (search, auth, custom actions) or when the path doesn't match resource() conventions:

ts
export const loginEndpoint = new BaseEndpoint({
  path: '/auth/login',
  method: 'POST' as const,
  body: {} as { email: string; password: string },
  schema: undefined,
});

Body typing: Use body: {} as BodyType (truthy value) — not undefined as unknown as BodyType. The truthy value is needed so the endpoint correctly sends a request body for POST/PUT/PATCH.

Coexisting with existing validation (Zod, Yup)

If the codebase already validates responses with Zod/Yup, prefer Entity as the source of truth for types that benefit from caching/normalization. Keep Zod only for types that don't need normalization (auth tokens, form validation types, one-off responses). See the migration reference files for detailed options.

Next Steps

  1. Define Entity classes (skill "data-client-schema") and wire them to endpoints via schema: — this is essential, not optional. Endpoints with schema: undefined bypass normalization and caching.
  2. Apply skill "data-client-rest" for resource and endpoint patterns
  3. Apply skill "data-client-react" or "data-client-vue" for hook-based usage

References

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

© 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 16 other files (scripts, references) in .agents/skills/data-client-rest-setup of reactive/data-client.

  • SKILL.md
  • references.json
  • references/RestEndpoint.md
  • references/RestEndpoint.vue.md
  • references/auth.md
  • references/auth.vue.md
  • references/axios-migration.md
  • references/django.md
  • references/fetch-migration.md
  • references/got-migration.md
  • references/hookifyResource.md
  • references/hookifyResource.vue.md
  • references/ky-migration.md
  • references/resource.md
  • references/resource.vue.md
  • references/superagent-migration.md
  • scripts/axios-to-rest.js

Open the folder on GitHubat commit 02c0932

Compare with similar skills

Data Client REST Setup 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 REST Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Data Client REST Setup this skillreactive/data-client2k—~2.9kAutomated safety check: PassApache-2.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Paperclippaperclipai/paperclip98k—~9.6kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15817 repos~4kAutomated safety check: PassAGPL-3.0
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT

Similar skills

  • 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
  • Paperclip

    paperclipai/paperclip

    Interact with the Paperclip control plane API for task coordination and governance.

    98k GitHub stars~9.6k tokensUpdated today
    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
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Covers the RuView `wifi-densepose` command line binary, its Axum REST API and the WebAssembly builds for browsers and ESP32, for embedding or scripting RuView.

    97k GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check: notes

More from reactive/data-client

All 17 skills in this repo
  • 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 Schema

    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…

    2k GitHub stars~2.3k 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

Categories

Questions about Data Client REST Setup

What does Data Client REST Setup do?

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

When should I use Data Client REST Setup?

Data Client REST Setup fits situations like: adopting @data-client/rest in a new; existing project.

How do I install Data Client REST Setup in Claude Code?

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

How do I install Data Client REST Setup in Codex?

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

Can I use Data Client REST Setup 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-rest-setup -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-rest-setup, .gemini/skills/data-client-rest-setup, .github/skills/data-client-rest-setup and .opencode/skills/data-client-rest-setup in your project.

What does Data Client REST Setup need to run?

Going by SKILL.md and its folder, Data Client REST Setup needs JavaScript for the scripts in its folder and the command-line tools its instructions call (npm, yarn, pnpm and npx). Our summary lists: Node.js.

Does Data Client REST Setup 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 REST Setup 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Data Client REST Setup use?

Data Client REST Setup is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Data Client REST Setup use?

About 2.9k tokens (SKILL.md is roughly 12k 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 54k tokens, read only when the agent opens those files.

What are the alternatives to Data Client REST Setup?

Skills that share tags, products or a category with Data Client REST Setup: API Designer (Jeffallan/claude-skills, 12k stars), Paperclip (paperclipai/paperclip, 98k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars) and OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Data Client REST Setup?

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.