implementing-warehouse-sources
БесплатноБез исполняемых скриптовНе проверенImplement and extend PostHog Data warehouse import sources. Use when adding a new source under products/warehouse_sources/sources/ (or changing one there or…
от PostHog★ 41 278 звёзд на GitHubОб этом скилле
Implementing Data warehouse sources
Use this skill when building or updating Data warehouse sources. New sources go in the products/warehouse_sources/sources/ tree, one directory per vendor (products/warehouse_sources/sources/AGENTS.md). Shared code (common/) and the vendors that other code imports stay in products/warehouse_sources/backend/temporal/data_imports/sources/.
Read first
Before coding, read:
products/warehouse_sources/sources/source.template(the top-of-file TODOs are the bootstrap checklist; still verify target files against current source implementations, since the template can drift)products/warehouse_sources/backend/temporal/data_imports/sources/README.mdproducts/warehouse_sources/backend/temporal/data_imports/sources/SOURCES.md— a hand-kept inventory of how sources talk to their upstream (HTTP / vendor SDK / gRPC / DB protocol / webhook) and their tracked-transport state. Skim it to see how similar sources are wired. A new vendor does not add a line; see "SOURCES.md" below.products/warehouse_sources/backend/temporal/data_imports/sources/common/base.py— base classes (SimpleSource,ResumableSource,WebhookSource) and theFieldTypeunionproducts/warehouse_sources/backend/temporal/data_imports/sources/common/resumable.py—ResumableSourceManagerproducts/warehouse_sources/backend/temporal/data_imports/sources/common/webhook_s3.py—WebhookSourceManagerproducts/warehouse_sources/sources/chargebee/— the canonical reference for a new REST source. It uses the sharedrest_sourceframework (declarativeRESTAPIConfig+rest_api_resource, framework auth + paginators, tracked+retrying transport) and is resumable — proof the framework covers the dominant "paginate a list endpoint and yield, resumably" shape. Read it first, alongside "Prefer the shared REST framework" below. Readproducts/warehouse_sources/sources/klaviyo/orproducts/warehouse_sources/backend/temporal/data_imports/sources/github/only as a bespoke-transport fallback: they hand-roll their client for edge cases (custom query-string encoding, multi-level fan-out, JSON:API reshaping) that most sources don't have — don't copy that boilerplate into a source that doesn't need it. For dependent-resource fan-out (parent→child withtype: "resolve"), also readproducts/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.pyandconfig_setup.py(e.g.process_parent_data_item,make_parent_key_name).- For webhook-capable sources, read
products/warehouse_sources/backend/temporal/data_imports/sources/stripe/source.pyas the reference implementation.
Picking the right base class
Every new source must inherit from one (or a combination) of these:
SimpleSource[Config]— default for straightforward pull-based APIs where each run fully iterates the endpoint.ResumableSource[Config, ResumableData]— preferred for any new API-backed source whose underlying API supports resumption (cursor/link-header pagination, time windows, offset tokens, or any other deterministic way to pick back up where we left off). If the API gives us a next-page token, aLinkheader, or a stable time filter, useResumableSource. This lets Temporal resume after heartbeat timeouts without restarting from scratch.save_statestages the cursor in memory; the pipeline commits it to Redis (24h TTL) right after it writes the rows yielded so far.WebhookSource[Config]— only when the source can push events to us (e.g. Stripe webhook endpoints). Typically combined withResumableSourceso the initial backfill is resumable and subsequent deltas come via webhook.
Combine by multiple inheritance when both apply, e.g.:
class StripeSource(
ResumableSource[StripeSourceConfig, StripeResumeConfig],
WebhookSource[StripeSourceConfig],
OAuthMixin,
):
...
Rule of thumb:
- Pull-only API, no cursor we can persist →
SimpleSource. - Pull-only API with any cursor/next-page/time-filter we can save between runs →
ResumableSource. - Source can call us back with change events → add
WebhookSourceon top of whichever pull base fits. - Source's next run starts from a position only the source can compute, not the max of a column → add
CursorSource.
Databases and file-transfer sources (SFTP, S3) stay on SimpleSource unless there's a clear reason otherwise.
Durable source cursors (CursorSource)
The incremental field covers the common case: the pipeline takes the max of a column and the next run filters above it.
Some positions are not a column max: a Postgres xmin ceiling captured before the read, or a set of Kafka partition offsets.
For those, add the CursorSource[CursorT] mixin from sources/common/cursor.py instead of new fields on SourceResponse or new keys in sync_type_config.
- Define the cursor as a
@frozendataclass with acursor_kind: ClassVar[str]. Keep the kind stable, because a
Установить implementing-warehouse-sources в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл implementing-warehouse-sources?
Implement and extend PostHog Data warehouse import sources. Use when adding a new source under products/warehouse_sources/sources/ (or changing one there or under products/warehouse_sources/backend/temporal/data_imports/sources), adding datasets/endpoints to an existing source, or adding incremental sync, resumable imports, webhook ingestion, pagination, credentials validation, and source tests.
Как установить скилл implementing-warehouse-sources?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл implementing-warehouse-sources запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic