use-fetch/SKILL.md
当用户要调用远程 HTTP 接口、封装 API 客户端或构造带认证/参数/请求体的请求时使用。适用于 GET/POST/PUT/DELETE 请求、查询参数、JSON/表单请求体、文件上传、请求头(如 Token)、取消请求。即使用户未明确提及"fetch"、"API"或"HTTP",只要涉及调用后端接口、请求远程数据或与服务器交互,也应使用本技能。
npx skillsauth add lchrennew/es-fetch-api use-fetchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
指导智能体在当前项目正确使用 es-fetch-api 发起远程接口调用。
getApi()、中间件链getApi(baseUrl) 创建 API 实例(baseUrl 支持字符串、异步函数或 undefined)api(endpoint?, ...middlewares)Response 处理结果:response.ok、await response.json()import { getApi, POST, json, query, header, abortable } from 'es-fetch-api'
完整行为见 middleware.md
| 需求 | 中间件 | 关键点 |
|------|--------|--------|
| JSON 请求体 | json(obj) | 方法需显式传 POST/PUT/PATCH |
| 表单请求体 | form(obj) | - |
| 文件上传 | file(name, file, filename?) | 已自带 POST |
| 查询参数 | query(params, options?) | 第二参数是配置对象 |
| 批量请求头 | header(obj) | 动态头用自定义中间件 |
| 取消请求 | abortable(controller) | - |
这些是非显而易见的行为,不知道会出错:
Response:不是 axios 对象,没有 data 字段,需显式调用 response.json() 或 response.text()json() 不会自动设置方法:必须显式传 POST/PUT/PATCH,否则仍是 GETnext():否则中间件链中断,请求不会真正发送file() 返回中间件数组:不要再包一层数组,直接展开即可query() 第二参数是配置对象:不是布尔值,支持 { append, includeUndefined, includeNull }baseUrl 是 undefined,endpoint 必须是绝对 URL更多坑点见 pitfalls.md
GET · POST JSON · POST Form · 文件上传 · 动态 baseUrl · 公共中间件 · 可取消请求 · 统一响应处理
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.