Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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.md
  • products/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 the FieldType union
  • products/warehouse_sources/backend/temporal/data_imports/sources/common/resumable.py — ResumableSourceManager
  • products/warehouse_sources/backend/temporal/data_imports/sources/common/webhook_s3.py — WebhookSourceManager
  • products/warehouse_sources/sources/chargebee/ — the canonical reference for a new REST source. It uses the shared rest_source framework (declarative RESTAPIConfig + 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. Read products/warehouse_sources/sources/klaviyo/ or products/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 with type: "resolve"), also read products/warehouse_sources/backend/temporal/data_imports/sources/common/rest_source/__init__.py and config_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.py as 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, a Link header, or a stable time filter, use ResumableSource. This lets Temporal resume after heartbeat timeouts without restarting from scratch. save_state stages 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 with ResumableSource so 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 WebhookSource on 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 @frozen dataclass with a cursor_kind: ClassVar[str]. Keep the kind stable, because a
Полный SKILL.md на GitHub

Установить implementing-warehouse-sources в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/oauth-app-deployment.mdreferences/testing.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить implementing-warehouse-sources с