update-api

update-api is a skill for Cursor from aide-family/moon-web. It costs 79 tokens per session (2,018 once invoked), scanned A, original, MIT.

A procedure for downloading an OpenAPI specification—a machine-readable description of web endpoints—and syncing it into frontend API modules under src/api/. It supports the account, marksman, and rabbit backend services.

In plain words
What is it for?
Updating API request code and types from a backend OpenAPI document, either for one supported service or for all of them.
Why use it?
It keeps frontend request functions and TypeScript types aligned with the backend documentation. This reduces mismatches between what pages send or expect and what the server actually provides.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Not installable on its own: it reads a path above its own folder, which only exists inside its repository. The line is import { http } from '../../index'.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for update-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/aide-family/moon-web/update-api.svg)](https://agentmods.dev/skills/aide-family/moon-web/update-api)
Your own site
<a href="https://agentmods.dev/skills/aide-family/moon-web/update-api"><img src="https://agentmods.dev/badge/skills/aide-family/moon-web/update-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,018 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.02018
Opus 5 $0.00039 $0.01009
Sonnet 5 $0.00016 $0.00404
Haiku 4.5 $0.00008 $0.00202

Measured 6d ago against content hash 65aa0d0b6cb3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

update-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/update-api/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

更新 API(Update API)

根据后端服务的 OpenAPI 文档,同步更新前端 src/api/ 下的请求与类型。代码风格遵循 React 与 TypeScript 规范。

项目约定

  • API 目录src/api/ 下每个一级目录对应一个后端服务:
    • account — 认证与用户
    • marksman — 策略与数据源
    • rabbit — 消息与发送
  • 文档地址:每个后端服务在根路径下提供 /doc/swagger/openapi.yaml,需从对应服务的 base URL 获取(如 https://api.example.com/account/doc/swagger/openapi.yaml)。
  • 请求封装:统一使用 src/api/common/request.tshttp(get/post/put/delete/patch),baseURL 为 /v1;路径写相对路径如 /datasources/user/${uid}
  • 模块结构:每个子模块(如 marksman/datasource)包含:
    • index.ts — 导出请求函数与 re-export 类型
    • types.ts — 请求/响应/枚举的 TypeScript 类型定义

工作流程

  1. 确认目标服务与文档 URL

    • 若用户未指定服务,询问要更新哪个服务(account / marksman / rabbit)或“全部”。
    • 确认该服务对应的 OpenAPI 文档完整 URL(例如 {服务 base URL}/doc/swagger/openapi.yaml)。若项目中有配置(如 .env、文档),优先使用;否则向用户确认。
  2. 获取并解析 OpenAPI

    • 使用 GET 请求或读取本地/网络文件获取 openapi.yaml(或 openapi.json)。
    • 解析 pathscomponents.schemas,得到接口路径、方法、请求体/查询参数、响应 schema。
  3. 映射到前端路径

    • 前端 baseURL 为 /v1,若 OpenAPI 中 path 已含 /v1 或前缀,生成请求路径时去掉重复前缀,只保留与 /v1 后一致的部分(如 /v1/datasources → 请求路径 /datasources)。
    • 按现有习惯:一个 OpenAPI tag 或资源名对应 src/api/<服务>/<子模块>/ 一个目录;若已有对应目录则更新,没有则新建并补全 index.tstypes.ts
  4. 更新 types.ts

    • 根据 components.schemas 生成 TypeScript 接口/类型;枚举与后端一致时使用 export enum,否则用 string 联合类型或 string
    • 命名与现有风格一致:列表项 XxxItem、列表参数 XxxListParamsListXxxParams、列表响应 XxxListResponseListXxxResponse、创建/更新参数 CreateXxxParamsUpdateXxxParams 等。
    • 所有字段可选用 ?,除非业务上明确必填;与后端一致的注释可保留简短说明。
  5. 更新 index.ts

    • ../../index../../common/request 引入 http(与现有模块一致,见 src/api/marksman/datasource/index.tssrc/api/account/user/index.ts)。
    • 每个 path + method 对应一个导出函数:使用 http.get<T>()http.post<T>()http.put<T>()http.delete<T>()http.patch<T>(),泛型 T 为响应类型。
    • 路径参数(如 uid)用模板字符串 `/path/${uid}`;query 作为第二参数传入;body 作为 post/put/patch 的第二参数。
    • 函数上方用 JSDoc 注释说明接口用途及路径,例如:/** 获取数据源列表 GET /v1/datasources */
    • 文件末尾统一 export type { ... } from './types' 以及需要的 export { EnumName } from './types',与现有模块一致。

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 121 lines · 79 tokens per session scan A 65aa0d0b6cb3

Subscribe to this mod's changes

update-api is a skill published in the GitHub repository aide-family/moon-web (12 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 2,018 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens