Agent skill

Openapi Typescript

by getopenpost in getopenpost/openpost

Type-safe OpenAPI consumption in TypeScript using openapi-typescript and openapi-fetch.

AGPL-3.0Auto-check passedBackend & APIs

Install Openapi Typescript

skills CLI
$ npx skills add getopenpost/openpost --skill openapi-typescript -a claude-code

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

GitHub CLI
$ gh skill install getopenpost/openpost openapi-typescript --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/getopenpost/openpost.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/openapi-typescript .claude/skills/openapi-typescript && 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
openapi-typescript
GitHub stars
653
Token cost
~887 tokens
SKILL.md length
133 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Type-safe OpenAPI consumption in TypeScript using openapi-typescript and openapi-fetch.

  • Works in 5 steps: Backend defines types via Huma →… → Frontend fetches spec from /openapi.json → openapi-typescript generates types.d.ts → …
  • Tasks that involve OpenAPI specifications
  • SKILL.md covers Type Generation, openapi-fetch Client, Auth Middleware and Re-exporting Schema Types, plus 5 more sections
  • Calls npx

What it does

Openapi Typescript is an agent skill from getopenpost/openpost. Type-safe OpenAPI consumption in TypeScript using openapi-typescript and openapi-fetch.

Its SKILL.md is about 890 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. It works with OpenAPI, TypeScript and Svelte. The repository describes itself as: Create, adapt, schedule, and track social posts. Open-source, hosted or self-hosted. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve OpenAPI specifications

Example prompts

  • “/openapi-typescript”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Backend defines types via Huma → auto-generates OpenAPI spec
  2. Frontend fetches spec from /openapi.json
  3. openapi-typescript generates types.d.ts
  4. openapi-fetch provides fully typed client
  5. Both sides stay in sync — type mismatches caught at compile time

What it can do on your machine

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

    • npx

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

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    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

Openapi Typescript loads about 887 tokens when it runs. Until then it costs about 27 tokens; SKILL.md has 133 words of instructions outside code blocks.

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

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 getopenpost/openpost at commit ed8ad44, republished under its AGPL-3.0 licence (© getopenpost). 133 words, ~887 tokens.

Download SKILL.mdSave it as .claude/skills/openapi-typescript/SKILL.md (or your agent's skills folder).
name
openapi-typescript
description
Type-safe OpenAPI consumption in TypeScript using openapi-typescript and openapi-fetch.
version
1.0.0
user-invocable
false

openapi-typescript + openapi-fetch

Type-safe OpenAPI consumption in TypeScript. Generates runtime-free types from OpenAPI specs and provides a typed fetch client.

Type Generation

bash
# Generate types from local spec
npx openapi-typescript openapi.json -o src/lib/api/types.d.ts

# Generate from running server
npx openapi-typescript http://localhost:8080/openapi.json -o src/lib/api/types.d.ts

# Check if types are up-to-date (CI)
npx openapi-typescript openapi.json -o src/lib/api/types.d.ts --check

openapi-fetch Client

typescript
import createClient from "openapi-fetch";
import type { paths } from "./types";

const client = createClient<paths>({ baseUrl: "/api/v1" });

// GET with query params
const { data, error } = await client.GET("/posts", {
  params: { query: { workspace_id: "123" } },
});

// POST with body
const { data, error } = await client.POST("/posts", {
  body: { workspace_id: "123", content: "Hello", social_account_ids: [] },
});

// Path params
const { data } = await client.GET("/accounts/{platform}/auth-url", {
  params: {
    path: { platform: "x" },
    query: { workspace_id: "123" },
  },
});

Auth Middleware

typescript
import createClient, { type Middleware } from "openapi-fetch";

const client = createClient<paths>({ baseUrl: "/api/v1" });

client.use({
  async onRequest({ request }) {
    const token = localStorage.getItem("token");
    if (token) {
      request.headers.set("Authorization", `Bearer ${token}`);
    }
    return request;
  },
});

Re-exporting Schema Types

typescript
// In client.ts
import type { paths, components } from "./types";

export type User = components["schemas"]["UserProfile"];
export type Workspace = components["schemas"]["WorkspaceResp"];
export type Post = components["schemas"]["PostResponse"];

Error Handling

Huma returns RFC 9457 Problem Details:

typescript
const { data, error } = await client.POST("/auth/login", {
  body: { email, password },
});
if (error) {
  // error is typed based on response schemas
  console.error(error.detail); // human-readable message
  console.error(error.status); // HTTP status code
  console.error(error.errors); // validation details
}

Svelte Integration

svelte
<script lang="ts">
    import { client, type Workspace } from '$lib/api/client';

    let workspaces = $state<Workspace[]>([]);

    async function load() {
        const { data, error } = await client.GET('/workspaces');
        if (!error && data) {
            workspaces = data;
        }
    }
</script>

Workflow

  1. Backend defines types via Huma → auto-generates OpenAPI spec
  2. Frontend fetches spec from /openapi.json
  3. openapi-typescript generates types.d.ts
  4. openapi-fetch provides fully typed client
  5. Both sides stay in sync — type mismatches caught at compile time

Scripts

json
{
  "scripts": {
    "generate:types": "openapi-typescript openapi.json -o src/lib/api/types.d.ts"
  }
}

Gotchas

  1. Fields named Status in OpenAPI schemas get treated as HTTP status codes — avoid on response body structs
  2. $schema field appears in generated types (Huma JSON Schema metadata) — ignore it in client code
  3. 0001-01-01T00:00:00Z is Go's zero time — handle in frontend date formatting
  4. openapi-typescript requires OpenAPI 3.0 or 3.1 (Huma generates 3.1)

© getopenpost, AGPL-3.0. 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 .agents/skills/openapi-typescript of getopenpost/openpost.

Open the folder on GitHubat commit ed8ad44

Compare with similar skills

Openapi Typescript 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.

Openapi Typescript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openapi Typescript this skillgetopenpost/openpost653—~887Automated safety check: PassAGPL-3.0
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Api2clialexknowshtml/api2cli455—~2.9kAutomated safety check: PassMIT
Projectsamchon/nestia2.2k—~3kAutomated safety check: PassMIT
API ContractChenyCHENYU/Robot_Admin1k—~1.9kAutomated safety check: PassMIT
Typescriptscalar/scalar16k—~1.1kAutomated safety check: PassMIT

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

    alexknowshtml/api2cli

    Generate a working CLI from any API, then wrap it in a Claude Code skill.

    455 GitHub stars~2.9k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Project

    samchon/nestia

    Defines the nestia product contract, workspace layout, package boundaries, the Go plugin composition model, and canonical commands.

    2.2k GitHub stars~3k tokensUpdated today
    Backend & APIsAuto-check passed
  • API Contract

    ChenyCHENYU/Robot_Admin

    A skill your agent uses when: generating TypeScript API layer (type definitions + request functions) from page-spec JSON or Swagger/OpenAPI docs.

    1k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Typescript

    scalar/scalar

    Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

    16k GitHub stars~1.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Spiceflow

    remorses/spiceflow

    Spiceflow is a super simple, fast, and type-safe API and React Server Components framework for TypeScript.

    167 GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from getopenpost/openpost

  • Openpost CLI

    getopenpost/openpost

    Operate a running OpenPost instance through the openpost CLI.

    653 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Cuelume

    getopenpost/openpost

    Add or audit OpenPost interaction sounds with Cuelume. An agent skill from getopenpost/openpost.

    653 GitHub stars~620 tokensUpdated yesterday
    Auto-check passed
  • Huma

    getopenpost/openpost

    Huma - Go REST/RPC API Framework. An agent skill from getopenpost/openpost.

    653 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Openpost SEO

    getopenpost/openpost

    Audit OpenPost marketing and documentation SEO with the pinned claude-seo toolkit.

    653 GitHub stars~766 tokensUpdated yesterday
    Auto-check passed
  • Agent Workflow

    getopenpost/openpost

    Coordinate substantial OpenPost features, refactors, or multi-ticket work.

    653 GitHub stars~811 tokensUpdated yesterday
    Auto-check passed
  • UX Consistency

    getopenpost/openpost

    OpenPost acceptance bar for frontend UI and copy changes. An agent skill from getopenpost/openpost.

    653 GitHub stars~680 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Openapi Typescript

What does Openapi Typescript do?

Type-safe OpenAPI consumption in TypeScript using openapi-typescript and openapi-fetch. Openapi Typescript is an agent skill from getopenpost/openpost. Type-safe OpenAPI consumption in TypeScript using openapi-typescript and openapi-fetch.

When should I use Openapi Typescript?

Openapi Typescript fits situations like: tasks that involve OpenAPI specifications.

How do I install Openapi Typescript in Claude Code?

Run `npx skills add getopenpost/openpost --skill openapi-typescript -a claude-code`. Or copy the skill folder (.agents/skills/openapi-typescript in getopenpost/openpost) into .claude/skills/openapi-typescript in your project. Claude Code loads it when a task matches its description.

How do I install Openapi Typescript in Codex?

Run `npx skills add getopenpost/openpost --skill openapi-typescript -a codex`. Or copy the skill folder (.agents/skills/openapi-typescript in getopenpost/openpost) into .agents/skills/openapi-typescript in your project. Codex loads it when a task matches its description.

Can I use Openapi Typescript 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 getopenpost/openpost --skill openapi-typescript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openapi-typescript, .gemini/skills/openapi-typescript, .github/skills/openapi-typescript and .opencode/skills/openapi-typescript in your project.

What does Openapi Typescript need to run?

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

Does Openapi Typescript access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Openapi Typescript 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 Openapi Typescript use?

Openapi Typescript is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openapi Typescript use?

About 887 tokens (SKILL.md is roughly 3.5k 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 Openapi Typescript?

Skills that share tags, products or a category with Openapi Typescript: OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), Api2cli (alexknowshtml/api2cli, 455 stars), Project (samchon/nestia, 2.2k stars) and API Contract (ChenyCHENYU/Robot_Admin, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openapi Typescript?

getopenpost (a GitHub organization) maintains it in getopenpost/openpost, which has 653 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 6, 2026.

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