routing-outbound-api-calls
БесплатноБез исполняемых скриптовНе проверенUse before adding or changing Python code that calls a third-party HTTP API from PostHog (a vendor REST call, a vendor SDK client, a scraping or enrichment…
от PostHog★ 41 278 звёзд на GitHubОб этом скилле
Routing outbound API calls
posthog/egress/ owns every outbound third-party API call that needs a shared budget or telemetry.
posthog/egress/README.md is the reference for the mechanisms, and each domain's own README.md holds the facts about that API.
This skill holds the procedure and the traps.
Route first
| Situation | Route |
|---|---|
A domain for the API exists (ls posthog/egress/*/README.md) |
Call its <domain>_request helper or typed client. Read its README for identity and lanes. Never add a second client. |
| New API, PostHog owns the credential, and the vendor publishes a request limit or bills per call | New gated domain: EgressClient, or AsyncEgressClient for an aiohttp client |
| New API, PostHog owns the credential, and the vendor publishes no request limit that a rate budget can model | New record-only domain: RecordedEgressClient |
| The customer owns the credential on their own vendor account, and no PostHog process shares it | No domain. Honor 429 and Retry-After at the caller. See "who owns the token" in /implementing-warehouse-sources. |
| Throttling requests that reach PostHog's own API | posthog/rate_limit.py, not egress |
A budget that needs burst capacity, refunds, or a real per-caller Retry-After |
/using-redis-token-buckets |
A secret-URL webhook (a Slack incoming webhook, an interactivity response_url) |
Out of scope. The URL is the credential, so it must never become a metric label. |
| A vendor calls PostHog (an inbound webhook) | /adding-inbound-webhooks |
Decide before you write code
Write these four answers into the domain README.md first.
Take each answer from the vendor's documentation or from production traffic, never from a sibling domain.
- Identity. The budget owner in the vendor's own id space: an installation, an account, a fleet. Never a PostHog row id. A secret identity goes through
scope_fingerprintbefore it becomes a scope. - Budget. A documented vendor limit means the budget stays under it. No documented limit means an operator ceiling on spend, read from settings. When the API already has a caller, check its peak requests per scope per minute and per hour before you pick numbers.
- Lanes. Keep the default reserve:
BATCHis denied at 70% of a window,NORMALat 90%. Passreserve={}only when every caller runs on one lane, say why in the limiter docstring, and add the domain to_FLAT_DOMAINSinposthog/egress/test/test_domains.py. Give every caller an explicit lane: a person waiting getsNORMAL, background work getsBATCH. A call built from user-controlled input never runsCRITICAL, becauseCRITICALis never shed. - Headers. Parse only the rate-limit headers the vendor documents, and declare a gauge only for those. A header with an undocumented encoding (epoch or seconds) gets no gauge.
Source every vendor fact
A limit, a cost, a quota, a header name, or a claim that a header is absent is a vendor fact.
Each one goes into the domain README.md with its evidence under ## Sources. test_domains.py fails a README without that section.
- Cite the vendor's own page. A PR description, a sibling domain, a code comment, a blog post, or a search-result summary is not a source. Open the page it points at and cite that.
- Render docs that need JavaScript. WebFetch returns an empty shell for a single-page docs site and can get a 429. Open the page in a headless browser (the Playwright MCP) or fetch the site's
llms-full.txt. A docs site that renders nothing is not proof that the vendor documents nothing. - Write "unverified" when no source loads. Never turn an unchecked fact into a confident sentence.
- Check the gauges after the first deploy. Query the domain's rate-limit gauges once the domain has traffic. An empty gauge means the hea
Установить routing-outbound-api-calls в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл routing-outbound-api-calls?
Use before adding or changing Python code that calls a third-party HTTP API from PostHog (a vendor REST call, a vendor SDK client, a scraping or enrichment service), and before adding or changing a domain under posthog/egress/: its budget, priority lanes, identity, metrics, or rate-limit headers. Routes the call to an existing egress domain, a new gated domain, a record-only domain, or no domain at all, names the reference domain to copy, and lists the tests that catch a missing priority reserve. Trigger terms: egress, outbound API, third-party API, vendor client, rate limit, 429, Retry-After, budget, priority lane, BATCH, reserve, EgressClient, RecordedEgressClient, github_request.
Как установить скилл routing-outbound-api-calls?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл routing-outbound-api-calls запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic