moon-web: Skill for Cursor

.cursor/skills/update-api/SKILL.md

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/.

This is aide-family/moon-web's own configuration. It tells Cursor how to work on moon-web itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything moon-web configures →

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

Reuse

Borrowing it

Nothing to install: this file belongs to aide-family/moon-web. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/aide-family/moon-web/main/.cursor/skills/update-api/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/aide-family/moon-web

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for update-api

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.5 $0.00032 $0.00807
Sonnet 5.5 $0.00016 $0.00404
Haiku 4.5 $0.00008 $0.00202

Measured 1mo ago against content hash 65aa0d0b6cb3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.ts 的 http(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)。
    • 解析 paths 与 components.schemas,得到接口路径、方法、请求体/查询参数、响应 schema。
  3. 映射到前端路径

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

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

    • 从 ../../index 或 ../../common/request 引入 http(与现有模块一致,见 src/api/marksman/datasource/index.ts、src/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. 1mo 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 4mo ago), licensed MIT. It adds 79 tokens to every session and 2,018 once invoked, about $0.0003 per session on Opus 5.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

mem0-oss-to-platform

Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…

mem0ai/mem0 · 217 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

dev-runtime

How the Node side of a dev stack runs without haven, and the backend host: pnpm dev (UI built once, backend reloading), pnpm dev:hmr (adds the Vite ui lane), tools/dev-runtime (api + worker in one Node process), backend reload on a file change, the debounce (quiet window + max wait), ports derived from PORT. Use when…

langwatch/langwatch · 172 tokens

api-design

Use when settling the contract of an API you expose, before implementation: resources/URLs, REST vs GraphQL, versioning, one RFC 9457 error envelope, pagination, idempotency — emitted as OpenAPI 3.1. NOT implementing the endpoints (that is fastapi/nestjs/go/nodejs), NOT auth hardening (that is secure-coding), NOT…

ericrisco/rsc-harness · 105 tokens