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.
curl -O https://raw.githubusercontent.com/aide-family/moon-web/main/.cursor/skills/update-api/SKILL.mdgit clone --depth 1 https://github.com/aide-family/moon-webWrote 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.
[](https://agentmods.dev/skills/aide-family/moon-web/update-api)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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 类型定义
工作流程
-
确认目标服务与文档 URL
- 若用户未指定服务,询问要更新哪个服务(account / marksman / rabbit)或“全部”。
- 确认该服务对应的 OpenAPI 文档完整 URL(例如
{服务 base URL}/doc/swagger/openapi.yaml)。若项目中有配置(如.env、文档),优先使用;否则向用户确认。
-
获取并解析 OpenAPI
- 使用 GET 请求或读取本地/网络文件获取
openapi.yaml(或openapi.json)。 - 解析
paths与components.schemas,得到接口路径、方法、请求体/查询参数、响应 schema。
- 使用 GET 请求或读取本地/网络文件获取
-
映射到前端路径
- 前端 baseURL 为
/v1,若 OpenAPI 中 path 已含/v1或前缀,生成请求路径时去掉重复前缀,只保留与/v1后一致的部分(如/v1/datasources→ 请求路径/datasources)。 - 按现有习惯:一个 OpenAPI tag 或资源名对应
src/api/<服务>/<子模块>/一个目录;若已有对应目录则更新,没有则新建并补全index.ts、types.ts。
- 前端 baseURL 为
-
更新 types.ts
- 根据
components.schemas生成 TypeScript 接口/类型;枚举与后端一致时使用export enum,否则用string联合类型或string。 - 命名与现有风格一致:列表项
XxxItem、列表参数XxxListParams或ListXxxParams、列表响应XxxListResponse或ListXxxResponse、创建/更新参数CreateXxxParams、UpdateXxxParams等。 - 所有字段可选用
?,除非业务上明确必填;与后端一致的注释可保留简短说明。
- 根据
-
更新 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',与现有模块一致。
- 从
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.
- 1mo ago First seen · 121 lines · 79 tokens per session scan A 65aa0d0b6cb3
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.
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…
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…
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".
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.
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…
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…