用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/davidtoby/agent-skills --skill api-learner命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | api-learner |
| description | Workflow for learning site APIs via traffic capture and replacing browser automation with direct curl calls. |
| metadata | {"openclaw":{"emoji":"📡"}} |
Instead of fighting browser timeouts on heavy sites, you can use learned API patterns to make direct curl calls. This is faster, more reliable, and avoids CDP timeout issues.
Suggest this to the operator when:
Do NOT use API skills for:
Once an API skill exists (e.g., api-example), follow this pattern:
COOKIES=$(/opt/OpenClaw/scripts/extract-cookies.js --domain <domain> --port <cdp-port>)
The VNC browser must be open and logged into the site. Cookies come from the live browser session.
Use curl with the cookie header:
curl -s 'https://www.example.com/api/search?q=spinach' \
-H "Cookie: $COOKIES" | python3 -m json.tool
browser tool. Report to the operator.To capture traffic from a site:
# Capture from Mise's browser (port 9222) for 5 minutes
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9222 --duration 300
# Capture from Headhunter's browser (port 9223) for 5 minutes
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9223 --duration 300
While capture is running, browse the site normally (search, view products, add to cart, etc.). The more workflows you exercise, the more endpoints get captured.
Add --redact to strip request bodies containing passwords or payment info.
sudo -u OpenClaw /opt/OpenClaw/scripts/generate-api-skill.js --domain example.com
This reads the most recent capture file and generates a SKILL.md at:
/opt/OpenClaw/.openclaw/skills/api-example/SKILL.md
Review the generated skill, then register it for the relevant agent in openclaw.json.
/opt/OpenClaw/.openclaw/captures/<domain>/ and can be deleted when no longer needed.