derive-client
Что он делает
Этот скилл записывает, что сайт отправляет и получает, пока вы им пользуетесь, а затем пишет небольшой скрипт или инструмент, который делает те же запросы напрямую. Это для тех, кто часто повторяет одну и ту же задачу на сайте.
Когда использовать
- ✓Когда вы хотите использовать данные сайта, не открывая каждый раз браузер.
- ✓Когда вас просят создать CLI для сайта, у которого нет официального API.
- ✓Когда нужно увидеть, какие внутренние эндпоинты использует сайт.
Ссылка на скилл
https://github.com/vercel-labs/agent-browser/blob/main/skill-data/derive-client/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Посмотри, как я один раз ищу рейсы на этом сайте, а потом создай скрипт, который делает такой же поиск за меня.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Браузер сохраняет файл HAR с сетевыми запросами, пока вы пользуетесь сайтом. ИИ изучает эти запросы и пишет клиента, который обращается к эндпоинтам напрямую.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
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.
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
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 allembeds binary bodies too (base64);--content nonedisables 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:
# 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
# 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-specificx-*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.jsonfor 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, orx-requested-with. - Keep pagination, sort, and filter parameters that appeared in the recorded query strings as function options.
5. Verify
Call every generated function against the live API and compare the response shape with the recording. Common failures:
| Symptom | Cause | Fix |
|---|---|---|
| 401/403 | Expired or missing session | Re-login via agent-browser, re-export cookies |
| 403/419 on writes | CSRF token is per-session or per-form | Fetch the token endpoint first, or keep that flow browser-driven |
| Works then breaks | Signed/expiring request params | Fall back to the browser for that step; derive the rest |
| Different shape than HAR | A/B tests or geo-dependent responses | Re-record and treat the union as optional fields |
Caveats
- Internal APIs are unversioned and change without notice — keep the HAR so
Частые вопросы
Нужно ли входить в аккаунт перед записью?
Да. Скилл советует войти до начала записи, чтобы учетные данные не попали в файл.
Проверяется ли созданный клиент?
Да. В скилле сказано, что каждый эндпоинт нужно реально вызвать, прежде чем считать работу законченной.
Нужен ли браузер после записи?
Нет. В скилле сказано, что клиенту не нужен браузер после первой записи.
Подробности
Оригинальное описание автора
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.
Популярность
- Звёзды на GitHub
- 45k
- Место в рейтинге
- #6357
- Лицензия
- Apache-2.0
- Обновлён
- 01.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
technical-writer
45kУчит агента писать и редактировать документацию для разработчиков: руководства, справочники API и страницы с решением проблем, с понятной структурой и точными примерами.
agentcore
45kПозволяет агенту запускать автоматизацию браузера в облачных браузерах AWS Bedrock AgentCore, используя ваш существующий вход в AWS, с теми же командами, что и для локального Chrome.
core
45kУчит агента управлять веб-браузером через снимки и ссылки на элементы: открывать страницы, нажимать кнопки, заполнять формы и читать содержимое.
dogfood
45kУчит агента тестировать веб-приложение, исследуя его, а затем писать отчет об ошибках со скриншотами и пошаговым описанием воспроизведения для каждой проблемы.
Похожие скиллы
tavily
394kПомогает агенту искать в интернете через Tavily и извлекать текст с конкретных веб-страниц, с настройками глубины, доменов и дат.
blogwatcher
394kПозволяет агенту следить за блогами и лентами RSS или Atom, проверять их на новые статьи и отмечать прочитанные.
data-scraper-agent
280kАгент автоматически собирает данные из любых открытых источников по расписанию, обогащает их и сохраняет. Для мониторинга данных в интернете.