derive-client 是什么?
derive-client 用 agent-browser 把获准访问的网站交互录成 HAR,从请求和响应中识别接口,再生成可脱离浏览器使用的脚本、CLI 或库。它适合反复执行相同站点流程,但依赖内部接口与会话,和读取正式公开 API 文档不同。
中文说明由本站依据来源整理;英文原文保留在页面下方。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
derive-client,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 derive-client
请在 Codex 的当前工作环境中安装并检查 derive-client 这个 Skill。
项目身份:vercel-labs/agent-browser / derive-client
来源:https://github.com/vercel-labs/agent-browser/blob/53384771fbafc261ba67608ac806dd5aa70b84f0/skill-data/derive-client/SKILL.md
已定位的源文件:skill-data/derive-client/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 derive-client
请在 Claude Code 的当前工作环境中安装并检查 derive-client 这个 Skill。
项目身份:vercel-labs/agent-browser / derive-client
来源:https://github.com/vercel-labs/agent-browser/blob/53384771fbafc261ba67608ac806dd5aa70b84f0/skill-data/derive-client/SKILL.md
已定位的源文件:skill-data/derive-client/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 derive-client
请在 Cursor Agent 的当前工作环境中安装并检查 derive-client 这个 Skill。
项目身份:vercel-labs/agent-browser / derive-client
来源:https://github.com/vercel-labs/agent-browser/blob/53384771fbafc261ba67608ac806dd5aa70b84f0/skill-data/derive-client/SKILL.md
已定位的源文件:skill-data/derive-client/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 derive-client
请在 当前 Agent 的当前工作环境中安装并检查 derive-client 这个 Skill。
项目身份:vercel-labs/agent-browser / derive-client
来源:https://github.com/vercel-labs/agent-browser/blob/53384771fbafc261ba67608ac806dd5aa70b84f0/skill-data/derive-client/SKILL.md
已定位的源文件:skill-data/derive-client/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 明确允许录制和调用的站点、账户与流程;有 agent-browser、可用登录态和受保护的本地 HAR 存储。
会得到什么
- 独立客户端源码、运行配置说明与逐函数验证结果;未验证的端点应单列。
实际使用顺序
- 需要登录时先登录再开始 HAR;为每个目标流程至少使用两组不同输入,录制搜索、详情或分页等真实请求。
- 通过 JSON 响应、第一方域名与操作相关性识别接口,排除埋点和静态资源。从请求体和响应正文导出实际字段与可选参数。
- 每个流程生成一个函数,身份从运行时文件或环境加载,保留观察到的分页、排序和过滤参数。
- 实际调用每个生成函数并比对响应形状;401/403先查身份,CSRF或短期签名不适合稳定重放时让该步骤回到浏览器。记录变化并保护HAR。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
教学示例:请用 derive-client 为我拥有的测试站点生成只读商品搜索客户端。录制两个关键词和两条详情,输出 search(query) 与 getItem(id),保留分页;凭证从本地运行配置读取,不写进源码。先只处理授权的只读流程。预期以真实流量推导输入输出,并逐函数调用核对;未执行的请求不能标成功。本站未录制或调用。
使用条件与边界
- 内部接口可能无版本承诺,登录、CSRF、签名和地域响应都可能使重放失效。
- HAR可能含cookies、tokens和业务数据,应排除版本控制并按任务结束后的保留约定处理。
- 浏览器中的授权不等于可以绕过站点访问控制或无限批量调用。
常见问题
只是重复我的浏览器任务也需要生成独立客户端吗?
源文件建议可先考虑 agent-browser flow 录制和重放;需要在 agent-browser 外部使用的脚本或库时,再采用此 Skill。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
skill-data/derive-client/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Reverse-engineer a website's internal API by recording browser traffic into a HAR file, then generate a standalone client or CLI that calls the endpoints directly, with no browser needed after the first recording. Use when asked to "derive a client", "build a CLI for <site>", "reverse engineer this site's API", "record network requests", "turn this site into an API", or when the same site will be automated repeatedly and direct HTTP calls would beat driving the browser every time.
查看源文件章节 / Source sections
- 原文:Derive an API client from a recorded session
- 工作流程 / Workflow
- 原文:1. Record
- 原文:2. Identify endpoints
- 原文:3. Extract shapes and auth
- 原文:4. Generate the client
- 原文:5. Verify
- 原文:Caveats
原文:Derive an API client from a recorded session
Driving a browser is the right tool for the first visit and the wrong tool for the hundredth. This skill records a site's network traffic once while you use it, then turns the captured requests into a standalone client (script, CLI, or library) that talks to the site's internal API directly. The recording alone contains everything needed: agent-browser embeds text response bodies (JSON/HTML/JS) in the HAR by default, so endpoint shapes can be studied offline after the browser is closed. For a task the agent itself will repeat, `agent-browser flow start` and `flow save` do steps 1 to 4 in the core and `flow run` replays it without a browser. Use this skill when you need a standalone client outside agent-browser.
工作流程 / Workflow
``` 1. Record Start HAR capture, drive the flows you want in the client 2. Identify Find the real API endpoints among the noise 3. Extract Pull request shapes, response schemas, and auth material 4. Generate Write the client, one function per flow 5. Verify Call every endpoint for real before declaring done ```
原文:1. Record
```bash agent-browser network har start # embeds text response bodies by default # ... drive the site: search, open a detail page, paginate, etc. ... agent-browser network har stop /tmp/site.har ``` - Exercise **every flow the client should support**, and run each one at least twice with different inputs (two search terms, two detail pages). Diffing the recorded URLs reveals which parts are parameters. - If the site needs login, log in **before** starting the HAR so credentials don't land in the recording unnecessarily. The session cookies are exported separately in step 3. - `--content all` embeds binary bodies too (base64); `--content none` disables embedding. Per-body cap is 2 MB. While the session is still open, `agent-browser network requests` and `network request <id>` give the same data interactively — but only the HAR survives navigation and browser close, so prefer it for anything multi-page.
原文:2. Identify endpoints
Query the HAR with `jq`: ```bash # All JSON API calls: method, URL, status jq -r '.log.entries[] | select(.response.content.mimeType | test("json")) | "\(.request.method) \(.response.status) \(.request.url)"' /tmp/site.har ``` Ignore analytics and infrastructure noise: telemetry endpoints (`/collect`, `/track`, `/beacon`, `/log`), third-party domains (google-analytics, segment, sentry, datadog, intercom, hotjar), and static assets. The real API is usually first-party, JSON, and correlates with the actions you performed.
原文:3. Extract shapes and auth
```bash # Full detail for one endpoint: request headers, POST body, response body jq '.log.entries[] | select(.request.url | test("api/search")) | {request: {method: .request.method, headers: .request.headers, postData: .request.postData.text}, response: .response.content.text}' /tmp/site.har ``` - **Response schema**: read `.response.content.text` — this is the real payload, use it to derive types. - **Auth**: compare request headers across endpoints. Look for `authorization`, `cookie`, `x-csrf-token`, `x-api-key`, and site-specific `x-*` headers. Replay only the ones that matter — test by omission in step 5. - **Cookies**: export the live session with `agent-browser cookies get --json > cookies.json` for the client to load at runtime. Never hardcode cookie values into generated source.
原文:4. Generate the client
- One function per recorded flow (`search(query)`, `getItem(id)`), typed from the observed response bodies. - Auth material (cookies, bearer tokens) loads from a file or environment variable, with a clear error telling the user to re-run the browser login when it expires. - Reproduce the headers the API actually requires — some sites 403 without a matching `user-agent`, `referer`, or `x-requested-with`. - Keep pagination, sort, and filter parameters that appeared in the recorded query strings as function options.
文件 SHA256:f0d6bff1ed4d849e7852128aee3e57bbf5877c737c79e29dd80e7a8372caa51d
仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。
Reverse-engineer a website's internal API by recording browser traffic into a HAR file, then generate a standalone client or CLI that calls the endpoints directly, with no browser needed after the first recording. Use when asked to "derive a client", "build a CLI for <site>", "reverse engineer this site's API", "record network requests", "turn this site into an API", or when the same site will be automated repeatedly and direct HTTP calls would beat driving the browser every time.
历史收录数据
| 来源仓库 | vercel-labs/agent-browser |
|---|---|
| Skill源路径 | skill-data/derive-client/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
