Agent skill · software engineering · aiskillstore

api-client

Use when setting up API clients - TanStack Query, Axios, JWT token management, error handling, or response parsing. NOT when plain fetch calls, non-API data handling, or unrelated UI logic. Triggers: "API client", "data fetching", "JWT token", "error handling", "paginated list", "TanStack Query".

Why this skill is useful

Adds specific implementation patterns for TanStack Query and Axios, including JWT management and error handling that the AI wouldn't reliably generate on its own.

What it needs

Requires @tanstack/react-query, axios installed locally. About 9k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

API Client Skill Overview Expert guidance for API client implementation using TanStack Query/Axios, including JWT token attachment via interceptors, global error handling with toasts, type-safe response parsing with Zod, and offline detection for robust data fetching. When This Skill Applies This skill triggers when users request: API Setup: "Setup API client", "Configure TanStack Query", "Axios instance" Data Fetching: "Fetch student data", "Get attendance", "API calls" JWT/Token: "Attach JWT token", "Bearer token headers", "Token refresh" Error Handling: "API error toast", "Handle 401", "Retry failed requests" Response Parsing: "Type-safe responses", "Zod validation", "Parse API data" Pagination: "Paginated list", "Infinite query", "Load more data" Core Rules 1. Setup: TanStack Query Configuration Requirements: Use TanStack Query v5 for data fetching Configure appropriate staleTime and gcTime Set retry strategy with exponential backoff Wrap app with QueryClientProvider Use Axios as fallback for complex scenarios 2. JWT: Interceptors Auto-Attach Requirements: Create Axios instance with baseURL and timeout Request interceptor attaches JWT from auth store Response interceptor handles 401 and token refresh Automatic redirect to login on refresh failure Type-safe methods with TypeScript generics 3. Errors: Global Handler Requirements: Global error handler with toast notifications Handle all HTTP status codes appropriately Zod schema validation for response parsing Automatic error display in toasts Success message handling for mutations 4. Parsing: Typed Responses, Optimistic Updates Requirements: Infinite queries for paginated lists Optimistic updates for immediate feedback Rollback on error Offline detection and handling AbortController for cancelable requests Output Requirements Code Files 1. API Client: lib/apiClient.ts - Axios instance with interceptors lib/queryClient.ts - TanStack Query configuration 2. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/api-client

View the source on GitHub

Browse the @skills marketplace