tuning-incremental-sync-config
它能做什么
这项技能让智能体调整已连接到 PostHog 数据仓库的数据表的同步设置。适合那些同步太频繁、太慢或追踪字段设置有误的人。
适用场景
- ✓当你想把表从全量刷新切换为增量同步的时候。
- ✓当某张表同步太慢或太频繁,你想修改其计划的时候。
- ✓当源表发生了变化,其同步设置需要跟上的时候。
技能链接
https://github.com/PostHog/posthog/blob/master/products/warehouse_sources/skills/tuning-incremental-sync-config/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的 orders 表切换为只同步新行,并把计划改为每天运行一次。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会读取该表当前的设置,并更新你要求的项目。大多数更改会在下一次同步时生效,但有少数更改(例如修改主键)需要格外小心,以免损坏数据。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Tuning incremental sync config
A sync's configuration lives on the ExternalDataSchema and can be changed any time via
external-data-schemas-partial-update. Most changes are non-destructive (take effect on the next sync), but a few
(switching sync_type, changing primary keys) require careful handling to avoid corrupting the synced data.
When to use this skill
- The user wants to change how an already-connected table is synced
- A diagnosis flagged the incremental field or primary key as wrong
- The table is syncing too often / not often enough
- Switching an incremental table to CDC (or vice versa)
- The source table was changed on the other side (new columns, dropped columns) and the sync config needs to catch up
If the user is setting up a brand-new source, use setting-up-a-data-warehouse-source instead — configuration is
chosen at creation time there.
Available tools
| Tool | Purpose |
|---|---|
external-data-schemas-retrieve |
Current sync_type, incremental_field, PKs, sync_frequency |
external-data-schemas-incremental-fields-create |
Refresh candidate incremental fields from the live source |
external-data-schemas-partial-update |
Apply the config change |
external-data-schemas-reload |
Trigger a sync with the new config |
external-data-schemas-resync |
Wipe and re-import from scratch when the change invalidates existing data |
external-data-schemas-delete-data |
Drop the synced table while keeping the schema entry |
external-data-sources-check-cdc-prerequisites-create |
Pre-flight Postgres CDC (only when switching to/from CDC) |
external-data-sources-webhook-info-retrieve |
Current webhook state (when switching to/from sync_type=webhook) |
external-data-sources-create-webhook-create |
Register a webhook after switching a schema to sync_type=webhook |
external-data-sources-update-webhook-inputs-create |
Rotate a webhook signing secret |
external-data-sources-delete-webhook-create |
Unregister webhook when switching schemas off sync_type=webhook |
The fields you can tune
From the partial-update endpoint:
| Field | Values | Notes |
|---|---|---|
sync_type |
full_refresh, incremental, append, cdc, webhook |
Source must support the target type — check via incremental-fields |
incremental_field |
Column name from the source | Must appear in incremental_fields list for the schema |
incremental_field_type |
datetime, date, timestamp, integer, numeric, objectid |
Must match the column's real type |
primary_key_columns |
Array of column names | Required for CDC. Used for upsert dedup on incremental |
cdc_table_mode |
consolidated, cdc_only, both |
Only meaningful when sync_type=cdc |
sync_frequency |
5min, 15min, 30min, 1hour, 6hour, 12hour, 24hour, 7day, 30day, never |
How often the table syncs. CDC: how often changes load, 7day max |
sync_time_of_day |
HH:MM:SS |
When sync_frequency is daily/weekly-scale |
should_sync |
true / false |
常见问题
修改同步设置会清除我的数据吗?
大多数更改是安全的,并会在下次同步时生效。少数更改需要谨慎处理,以免损坏已同步的数据。
我可以切换到变更数据捕获吗?
可以。这项技能涵盖增量同步与变更数据捕获(change data capture)同步模式之间的切换。
新数据源应该用这项技能吗?
不应该。新数据源的设置在创建时就已选定,所以应使用数据源设置技能。
详情
作者的原始描述
Change the sync configuration of an existing data warehouse schema — switch sync_type, pick a different incremental_field, set primary_key_columns, choose cdc_table_mode, or change sync_frequency. Use when the user asks "switch my orders table from full refresh to incremental", "this table is syncing too slowly / too frequently", "I need to pick a different incremental column", "set up CDC for this Postgres table", or when diagnosis of a failing sync pointed to an incremental-field or PK misconfiguration.
repo: PostHog/posthog
热度
- GitHub 星标
- 41k
- 排名
- #6971
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
depot-ci
41k帮你的智能体设置并运行 Depot CI 工作流(GitHub Actions 的替代方案),包括迁移现有工作流和读取运行日志。
depot-container-builds
41k帮你的智能体在 Depot 的远程构建器上构建 Docker 镜像,包括多平台镜像、推送到镜像仓库,以及修复构建失败。
depot-github-runners
41k帮你的智能体把 GitHub Actions 任务迁移到 Depot 托管的运行器上,选择运行器规格和标签,并排查运行器设置问题。
editing-agents-md
41k帮你的智能体判断某条规则应写入 AGENTS.md 还是 CLAUDE.md,并以不会让文件臃肿的方式写下,确保规则真正生效。