Agent skill

API Integration

by MadAppGang in MadAppGang/claude-code

A skill your agent uses when integrating Apidog + OpenAPI specifications with your React app.

MITAuto-check passedBackend & APIs

Install API Integration

skills CLI
$ npx skills add MadAppGang/claude-code --skill api-integration -a claude-code

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

GitHub CLI
$ gh skill install MadAppGang/claude-code api-integration --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/MadAppGang/claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/frontend/skills/api-integration .claude/skills/api-integration && 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
api-integration
GitHub stars
284
Token cost
~2.6k tokens
SKILL.md length
262 words
Files
1
Skills in repo
69
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when integrating Apidog + OpenAPI specifications with your React app.

  • Works in 5 steps: Expose OpenAPI from Apidog → Wire MCP Server → Generate Types & Client → …
  • Integrating Apidog + OpenAPI specifications with your React app
  • SKILL.md covers Goal, Architecture, Process and Validation Strategy, plus 5 more sections
  • Calls pnpm and npx; reaches api.main.com and api.auth.com

What it does

API Integration is an agent skill from MadAppGang/claude-code. Use when integrating Apidog + OpenAPI specifications with your React app. Covers MCP server setup, type generation, and query layer integration. Use when setting up API clients, generating types from OpenAPI, or integrating with Apidog MCP.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering OpenAPI specifications, Third-party API integration and MCP servers. It works with Model Context Protocol, OpenAPI and React. The repository describes itself as: claude code plugins marketplace. The licence is MIT.

When your agent uses it

  • Integrating Apidog + OpenAPI specifications with your React app
  • Setting up API clients
  • Generating types from OpenAPI
  • Integrating with Apidog MCP

Example prompts

  • “/api-integration”

Requirements

  • Node.js

Workflow steps

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

  1. Expose OpenAPI from Apidog
  2. Wire MCP Server
  3. Generate Types & Client
  4. Create HTTP Client
  5. Build Query Layer

What it can do on your machine

Read from SKILL.md and the folder at commit 6097ad4. 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

    Shell commands in SKILL.md call:

    • pnpm
    • npx

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.main.com
    • api.auth.com

    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

API Integration loads about 2.6k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 262 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

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 MadAppGang/claude-code at commit 6097ad4, republished under its MIT licence (© MadAppGang). 262 words, ~2,554 tokens.

Download SKILL.mdSave it as .claude/skills/api-integration/SKILL.md (or your agent's skills folder).
name
api-integration
description
Use when integrating Apidog + OpenAPI specifications with your React app. Covers MCP server setup, type generation, and query layer integration. Use when setting up API clients, generating types from OpenAPI, or integrating with Apidog MCP.
updated
2026-01-20
keywords
api, openapi, apidog, mcp, type-generation, http-client, axios, zod

API Integration (Apidog + MCP)

Integrate OpenAPI specifications with your frontend using Apidog MCP for single source of truth.

Goal

The AI agent always uses the latest API specification to generate types and implement features correctly.

Architecture

Apidog (or Backend)
  → OpenAPI 3.0/3.1 Spec
    → MCP Server (apidog-mcp-server)
      → AI Agent reads spec
        → Generate TypeScript types
          → TanStack Query hooks
            → React Components

Process

1. Expose OpenAPI from Apidog

Option A: Remote URL

  • Export OpenAPI spec from Apidog
  • Host at a URL (e.g., https://api.example.com/openapi.json)

Option B: Local File

  • Export OpenAPI spec to file
  • Place in project (e.g., ./api-spec/openapi.json)
2. Wire MCP Server
json
// .claude/mcp.json or settings
{
  "mcpServers": {
    "API specification": {
      "command": "npx",
      "args": [
        "-y",
        "apidog-mcp-server@latest",
        "--oas=https://api.example.com/openapi.json"
      ]
    }
  }
}

With Local File:

json
{
  "mcpServers": {
    "API specification": {
      "command": "npx",
      "args": [
        "-y",
        "apidog-mcp-server@latest",
        "--oas=./api-spec/openapi.json"
      ]
    }
  }
}

Multiple APIs:

json
{
  "mcpServers": {
    "Main API": {
      "command": "npx",
      "args": ["-y", "apidog-mcp-server@latest", "--oas=https://api.main.com/openapi.json"]
    },
    "Auth API": {
      "command": "npx",
      "args": ["-y", "apidog-mcp-server@latest", "--oas=https://api.auth.com/openapi.json"]
    }
  }
}
3. Generate Types & Client

Create /src/api directory for all API-related code:

/src/api/
  ├── types.ts          # Generated from OpenAPI
  ├── client.ts         # HTTP client (axios/fetch)
  ├── queries/          # TanStack Query hooks
  │   ├── users.ts
  │   ├── posts.ts
  │   └── ...
  └── mutations/        # TanStack Mutation hooks
      ├── users.ts
      ├── posts.ts
      └── ...

Option A: Hand-Written Types (Lightweight)

typescript
// src/api/types.ts
import { z } from 'zod'

// Define schemas from OpenAPI
export const UserSchema = z.object({
  id: z.string(),
  name: z.string(),
  email: z.string().email(),
  createdAt: z.string().datetime(),
})

export type User = z.infer<typeof UserSchema>

export const CreateUserSchema = UserSchema.omit({ id: true, createdAt: true })
export type CreateUserDTO = z.infer<typeof CreateUserSchema>

Option B: Code Generation (Recommended for large APIs)

bash
# Using openapi-typescript
pnpm add -D openapi-typescript
npx openapi-typescript https://api.example.com/openapi.json -o src/api/types.ts

# Using orval
pnpm add -D orval
npx orval --input https://api.example.com/openapi.json --output src/api
4. Create HTTP Client
typescript
// src/api/client.ts
import axios from 'axios'
import createAuthRefreshInterceptor from 'axios-auth-refresh'

export const apiClient = axios.create({
  baseURL: import.meta.env.VITE_API_URL,
  headers: {
    'Content-Type': 'application/json',
  },
})

// Request interceptor - add auth token
apiClient.interceptors.request.use((config) => {
  const token = localStorage.getItem('accessToken')
  if (token) {
    config.headers.Authorization = `Bearer ${token}`
  }
  return config
})

// Response interceptor - handle token refresh
const refreshAuth = async (failedRequest: any) => {
  try {
    const refreshToken = localStorage.getItem('refreshToken')
    const response = await axios.post('/auth/refresh', { refreshToken })

    const { accessToken } = response.data
    localStorage.setItem('accessToken', accessToken)

    failedRequest.response.config.headers.Authorization = `Bearer ${accessToken}`
    return Promise.resolve()
  } catch (error) {
    localStorage.removeItem('accessToken')
    localStorage.removeItem('refreshToken')
    window.location.href = '/login'
    return Promise.reject(error)
  }
}

createAuthRefreshInterceptor(apiClient, refreshAuth, {
  statusCodes: [401],
  pauseInstanceWhileRefreshing: true,
})
5. Build Query Layer

Feature-based query organization:

typescript
// src/api/queries/users.ts
import { queryOptions } from '@tanstack/react-query'
import { apiClient } from '../client'
import { User, UserSchema } from '../types'

// Query key factory
export const usersKeys = {
  all: ['users'] as const,
  lists: () => [...usersKeys.all, 'list'] as const,
  list: (filters: string) => [...usersKeys.lists(), { filters }] as const,
  details: () => [...usersKeys.all, 'detail'] as const,
  detail: (id: string) => [...usersKeys.details(), id] as const,
}

// API functions
async function fetchUsers(): Promise<User[]> {
  const response = await apiClient.get('/users')
  return z.array(UserSchema).parse(response.data)
}

async function fetchUser(id: string): Promise<User> {
  const response = await apiClient.get(`/users/${id}`)
  return UserSchema.parse(response.data)
}

// Query options
export function usersListQueryOptions() {
  return queryOptions({
    queryKey: usersKeys.lists(),
    queryFn: fetchUsers,
    staleTime: 30_000,
  })
}

export function userQueryOptions(id: string) {
  return queryOptions({
    queryKey: usersKeys.detail(id),
    queryFn: () => fetchUser(id),
    staleTime: 60_000,
  })
}

// Hooks
export function useUsers() {
  return useQuery(usersListQueryOptions())
}

export function useUser(id: string) {
  return useQuery(userQueryOptions(id))
}

Mutations:

typescript
// src/api/mutations/users.ts
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { apiClient } from '../client'
import { CreateUserDTO, User, UserSchema } from '../types'
import { usersKeys } from '../queries/users'

async function createUser(data: CreateUserDTO): Promise<User> {
  const response = await apiClient.post('/users', data)
  return UserSchema.parse(response.data)
}

export function useCreateUser() {
  const queryClient = useQueryClient()

  return useMutation({
    mutationFn: createUser,
    onSuccess: (newUser) => {
      // Add to cache
      queryClient.setQueryData(usersKeys.detail(newUser.id), newUser)

      // Invalidate list
      queryClient.invalidateQueries({ queryKey: usersKeys.lists() })
    },
  })
}

Validation Strategy

Always validate API responses:

typescript
import { z } from 'zod'

// Runtime validation
async function fetchUser(id: string): Promise<User> {
  const response = await apiClient.get(`/users/${id}`)

  try {
    return UserSchema.parse(response.data)
  } catch (error) {
    console.error('API response validation failed:', error)
    throw new Error('Invalid API response format')
  }
}

Or use safe parse:

typescript
const result = UserSchema.safeParse(response.data)

if (!result.success) {
  console.error('Validation errors:', result.error.errors)
  throw new Error('Invalid user data')
}

return result.data

Error Handling

Global error handling:

typescript
import { QueryCache } from '@tanstack/react-query'

const queryCache = new QueryCache({
  onError: (error, query) => {
    if (axios.isAxiosError(error)) {
      if (error.response?.status === 404) {
        toast.error('Resource not found')
      } else if (error.response?.status === 500) {
        toast.error('Server error. Please try again.')
      }
    }
  },
})

Best Practices

  1. Single Source of Truth - OpenAPI spec via MCP is authoritative
  2. Validate Responses - Use Zod schemas for runtime validation
  3. Encapsulation - Keep all API details in /src/api
  4. Type Safety - Export types from generated/hand-written schemas
  5. Error Handling - Handle auth errors, network errors, validation errors
  6. Query Key Factories - Hierarchical keys for flexible invalidation
  7. Feature-Based Organization - Group queries/mutations by feature

Workflow with AI Agent

  1. Agent reads latest OpenAPI spec via Apidog MCP
  2. Agent generates or updates types in /src/api/types.ts
  3. Agent implements queries following established patterns
  4. Agent creates mutations with proper invalidation
  5. Agent updates components to use new API hooks

Example: Full Feature Implementation

typescript
// 1. Types (generated or hand-written)
// src/api/types.ts
export const TodoSchema = z.object({
  id: z.string(),
  text: z.string(),
  completed: z.boolean(),
})
export type Todo = z.infer<typeof TodoSchema>

// 2. Queries
// src/api/queries/todos.ts
export const todosKeys = {
  all: ['todos'] as const,
  lists: () => [...todosKeys.all, 'list'] as const,
}

export function todosQueryOptions() {
  return queryOptions({
    queryKey: todosKeys.lists(),
    queryFn: async () => {
      const response = await apiClient.get('/todos')
      return z.array(TodoSchema).parse(response.data)
    },
  })
}

// 3. Mutations
// src/api/mutations/todos.ts
export function useCreateTodo() {
  const queryClient = useQueryClient()

  return useMutation({
    mutationFn: async (text: string) => {
      const response = await apiClient.post('/todos', { text })
      return TodoSchema.parse(response.data)
    },
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: todosKeys.lists() })
    },
  })
}

// 4. Component
// src/features/todos/TaskList.tsx
export function TaskList() {
  const { data: todos } = useQuery(todosQueryOptions())
  const createTodo = useCreateTodo()

  return (
    <div>
      {todos?.map(todo => <TodoItem key={todo.id} {...todo} />)}
      <AddTodoForm onSubmit={(text) => createTodo.mutate(text)} />
    </div>
  )
}
  • tanstack-query - Query and mutation patterns
  • tooling-setup - TypeScript configuration for generated types
  • core-principles - Project structure with /src/api directory

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

Files

Just SKILL.md in plugins/frontend/skills/api-integration of MadAppGang/claude-code.

Open the folder on GitHubat commit 6097ad4

Compare with similar skills

API Integration 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.

API Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Integration this skillMadAppGang/claude-code284—~2.6kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
API Endpoint Contracttrycompai/comp2k—~2.7kAutomated safety check: PassAGPL-3.0
SpikardGoldziher/spikard123—~799Automated safety check: PassMIT
Kingdee MCP DevWaHaiLong/KingdeeMCP103—~853Automated safety check: PassMIT
Frontmcp Developmentagentfront/frontmcp146—~11kAutomated safety check: PassApache-2.0

Similar skills

  • 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
  • API Endpoint Contract

    trycompai/comp

    The contract every new or modified API endpoint must follow so it is correct for the public OpenAPI spec, the MCP server (npm @trycompai/mcp-server), the ValidationPipe, and the docs.

    2k GitHub stars~2.7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Spikard

    Goldziher/spikard

    Scaffold Spikard projects and generate code from OpenAPI, AsyncAPI, OpenRPC, GraphQL, and Protobuf schemas using the Spikard CLI or its MCP server.

    123 GitHub stars~799 tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Kingdee MCP Dev

    WaHaiLong/KingdeeMCP

    Knowledge base for the Kingdee MCP Dev Squad. An agent skill from WaHaiLong/KingdeeMCP.

    103 GitHub stars~853 tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Frontmcp Development

    agentfront/frontmcp

    A skill your agent uses when building any FrontMCP server component other than a tool (for tools, use create-tool).

    146 GitHub stars~11k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Azure Aigateway

    microsoft/GitHub-Copilot-for-Azure

    Official

    Configure Azure API Management as an AI Gateway for AI models, MCP tools, and agents.

    255 GitHub starsUsed in 2 repos~1.3k tokens
    Backend & APIsAuto-check passed

More from MadAppGang/claude-code

All 69 skills in this repo
  • API Spec Analyzer

    MadAppGang/claude-code

    Analyzes API documentation from OpenAPI specs to provide TypeScript interfaces, request/response formats, and implementation guidance.

    284 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Content Brief

    MadAppGang/claude-code

    Content brief template and creation methodology for SEO-optimized content.

    284 GitHub starsUsed in 1 repo~959 tokens
    Auto-check passed
  • Context Detection

    MadAppGang/claude-code

    A skill your agent uses when detecting project technology stack from files/configs/directory structure, auto-loading framework-specific skills, or analyzing multi-stack fullstack projects (e.g…

    284 GitHub stars~5.4k tokensUpdated 6 mo ago
    Auto-check passed
  • Content Optimizer

    MadAppGang/claude-code

    On-page SEO optimization techniques including keyword density, meta tags, heading structure, and readability.

    284 GitHub starsUsed in 1 repo~694 tokens
    Auto-check passed
  • Keyword Cluster Builder

    MadAppGang/claude-code

    Techniques for expanding seed keywords and clustering by topic and intent.

    284 GitHub starsUsed in 1 repo~674 tokens
    Auto-check passed
  • Serp Analysis

    MadAppGang/claude-code

    SERP analysis techniques for intent classification, feature identification, and competitive intelligence.

    284 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed

Categories

Questions about API Integration

What does API Integration do?

A skill your agent uses when integrating Apidog + OpenAPI specifications with your React app. API Integration is an agent skill from MadAppGang/claude-code. Use when integrating Apidog + OpenAPI specifications with your React app.

When should I use API Integration?

API Integration fits situations like: integrating Apidog + OpenAPI specifications with your React app; setting up API clients; generating types from OpenAPI; integrating with Apidog MCP.

How do I install API Integration in Claude Code?

Run `npx skills add MadAppGang/claude-code --skill api-integration -a claude-code`. Or copy the skill folder (plugins/frontend/skills/api-integration in MadAppGang/claude-code) into .claude/skills/api-integration in your project. Claude Code loads it when a task matches its description.

How do I install API Integration in Codex?

Run `npx skills add MadAppGang/claude-code --skill api-integration -a codex`. Or copy the skill folder (plugins/frontend/skills/api-integration in MadAppGang/claude-code) into .agents/skills/api-integration in your project. Codex loads it when a task matches its description.

Can I use API Integration 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 MadAppGang/claude-code --skill api-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-integration, .gemini/skills/api-integration, .github/skills/api-integration and .opencode/skills/api-integration in your project.

What does API Integration need to run?

Going by SKILL.md and its folder, API Integration needs the command-line tools its instructions call (pnpm and npx). Our summary lists: Node.js.

Does API Integration access the network?

SKILL.md names 2 domains. In commands or code: api.main.com and api.auth.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is API Integration 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 API Integration use?

API Integration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Integration use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to API Integration?

Skills that share tags, products or a category with API Integration: OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), API Endpoint Contract (trycompai/comp, 2k stars), Spikard (Goldziher/spikard, 123 stars) and Kingdee MCP Dev (WaHaiLong/KingdeeMCP, 103 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Integration?

MadAppGang (a GitHub organization) maintains it in MadAppGang/claude-code, which has 284 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on March 15, 2026.

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