/drt:drt-create-syncfrom drt
Generates a drt sync YAML configuration for Reverse ETL pipelines, connecting data warehouse tables to external services like Slack, HubSpot, or BigQuery.
Ships in drt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create a drt sync YAML configuration file for the user.
Ask the user for the following (or infer from context if already provided):
ref('new_users') or a SQL query)upsert_key). Replace/mirror are supported on Postgres, MySQL, ClickHouse, Snowflake, Databricks, and BigQuery. Mirror strategy: destination (default) compares with the whole target; strategy: tracked deletes only rows drt previously synced and can combine with scope on all five non-BigQuery warehouse destinations; strategy: diff deletes exact removals from snapshot-diff incremental and works on all six, but rejects scope. BigQuery does not support tracked.mode: incremental + cursor_field) when the model has a reliable monotonic column. For a Postgres, Snowflake, Databricks, or BigQuery source without one, offer mode: upsert (or mirror) + incremental_strategy: diff + destination upsert_key; optionally set diff.hash_columns to a non-empty list instead of all. This materializes full snapshots in the source profile's managed_schema, needs warehouse create/write/drop privileges, and same-sync runs must not overlap. --limit never promotes the snapshot baseline.sync.match_policy (v0.8.1, #757) narrows the upsert write path (mode: full / upsert / incremental) to one side — update_only touches only rows that already exist in the destination (no-match rows are skipped, not created — the CRM enrichment case: push warehouse-computed fields into records reps already made), create_only inserts only rows that don't yet exist (existing left untouched). Skips are counted in SyncResult.skipped / skipped_no_match (shown as … N skipped (M no match)), never errors. Rejected for mode: replace / mirror; fails fast on destinations that don't implement it. Supported on Postgres and HubSpot as of v0.8.1; other SaaS / SQL destinations followsync.write_policy: fill_empty (v1.2, #1238) makes an upsert write a column only where the destination's value is empty — NULL, '', or spaces-only text; a stored 0 is a value, not empty. The CRM-enrichment case: fill industry/segment from the warehouse without clobbering a rep's edits. Use write_policy_overrides: {col: overwrite} for columns that must always be refreshed. Supported on Postgres, MySQL, Snowflake, Databricks, BigQuery and HubSpot; rejected with destination.mode: insert and sync.mode: replace (validated at config time; create_only has nothing to fill, and update_only is only on Postgres, MySQL and HubSpot). See docs/guides/write-policy.mdmirror or replace, add sync.guards: {max_deletes: N, max_delete_pct: P} (v1.2, #1218) so a bad run cannot delete unbounded rows; max_creates / max_updates_pct apply to drt plan / drt apply. A tripped guard fails the run loudly (it never silently clips). Run-time enforcement covers the destinations listed in docs/guides/plan.md. See that guide before promising a destinationcolumns: [{name, type, description}] (portable types string, number, integer, boolean, timestamp, date, json) and contract: {enforced: true, on_extra_columns: fail|ignore|drop} (v1.3, #761). The first extracted batch is checked before any write, so a renamed or retyped model column fails the run instead of reaching HubSpot or a production table. With a dbt project, contract: {enforced: true, source: dbt} derives the columns from an enforced dbt model contract in target/manifest.json (#896; only an unqualified ref('model'), no local syncs/models/<name>.sql override). A hand-written columns: block wins over dbt. See docs/guides/column-contracts.md.manage_table: true and on_schema_change: fail | ignore | append_new_columns (v1.3, #760, default fail). drt creates the table (types from the declared columns, else TEXT) and may add nullable columns; it never drops, renames or retypes. drt plan / --dry-run show the DDL without running it. Needs CREATE/ALTER privileges. Other destinations reject both keys. See docs/guides/managed-destination-tables.md.meta: {owner, owner_email, maturity} (catalog only; the e-mail is personal data and never reaches dbt exposures) and alerts.on_stale: {max_age: 6h}; drt status --check exits non-zero for a stale or never-run sync (v1.3, #1224/#1226; see docs/guides/alerts.md).batch_size and rate_limitsync.field_mappings: {source_column: destination_field} (#415) instead of aliasing in SQL — applied just before the destination, so cursor_field / lookups / computed_fields use source names while upsert_key / destination columns use the mapped namesfull_name, E.164 phone, epoch-millis timestamp, an environment stamp), use sync.computed_fields: {field_name: "<jinja>"} (#763) rather than adding a destination-specific column to the dbt mart. Reads source column names as {{ row.col }}; same Jinja env / filters / StrictUndefined as body_template. Transform order is computed_fields → field_mappings → mask. A single-expression template keeps the Python value's type ({{ row.n * 1000 }} → 5000, not "5000"); anything with surrounding text renders as a string. A computed field can never read another one (order-independent). Writing an existing column name replaces it in place and reads the original value. ⚠️ A null passed through a filter renders as the string "None" — write {{ (row.phone or '') | replace('-','') }}. See docs/guides/computed-fields.mdsync.mask (v0.7.10, #427/#660). Flat form for parameter-less strategies — sync.mask: {email: hash, ssn: redact} (hash = SHA-256 hex, redact = [REDACTED]); object form for truncate — sync.mask: {name: {strategy: truncate, length: 2}} (keeps the first N chars). Runs at the same seam as field_mappings (after the rename), so mask keys reference the destination-facing field name; nulls pass through, works on every destination. See docs/guides/pii-masking.mdsync.metadata_columns: {synced_at: _drt_synced_at, run_id: _drt_run_id, sync_name: _drt_sync_name} (#762) — any subset of the three. Plain dict enrichment at the engine seam (not DDL), so the target column must already exist on the destination. Runs last of every transform, after mask — the opposite end from computed_fields, since these are engine bookkeeping values, not derived from source data. See docs/guides/metadata-columns.mdvars: block in drt_project.yml and be referenced as {{ var('name') }} / {{ var('name', default) }} in the model SQL and in YAML string fields (v0.8.0, #783). Override per run with drt run --vars 'lookback_days: 1' (precedence: --vars > DRT_VAR_<NAME> env > project vars:). An undefined var with no default is a drt validate errormanaged_schema: _drt. Project state: {backend: warehouse, connection_profile: <profile>} stores run state, history, and DLQ there. This is separate from sync.watermark.storage. Any *_env field may instead contain an aws-sm://, gcp-sm://, or vault:// secret-provider URI when the matching extra is installed.native_idempotency_key through native_idempotency_header; Google Ads maps it to orderId. Do not claim protection for destinations where drt validate says the field is unwired. For staged_upload, set public YAML field rate_limit_key to a stable, non-secret quota identity when regional hosts share a vendor quota or independent accounts share a host.column mismatch; increase sync.batch_size so sparse fields appear in batch one. For historical Klaviyo events, use backfill: true (revision 2026-07-15 or newer) to avoid firing live flows, then turn it off for live incremental events.Generate a valid sync YAML using the exact field names from docs/llm/API_REFERENCE.md.
Output the YAML in a code block and suggest where to save it: syncs/<name>.yml
Show the commands to check, preview, then run it:
drt validate # YAML schema check
drt list # confirm the new sync is discovered
drt run --select <name> --dry-run --diff # preview actions/field changes — no data written
drt plan <name> --out plan.json # (v1.2) reviewable change set; then `drt apply plan.json` — SQL databases/warehouses only
drt run --select <name> --limit 10 # real send, capped at 10 rows
drt run --select <name> # full run
drt list is worth the extra line: sync discovery is glob-based, so a file
saved outside syncs/ or with a mismatched name: validates cleanly and then
silently never runs.
If the sync declares a tests: block, show how to run it after the sync:
drt test --select <name> # post-sync validation (row counts, freshness, unique, custom SQL)
drt build --select <name> # run + test in one pass
If the sync uses computed_fields, field_mappings, and/or mask (anything that reshapes a record before it
reaches the destination), offer to generate a top-level unit_tests block too (#780) — one or
two fixture rows through the transform, verified with zero credentials and zero network:
unit_tests:
- name: <describes what it checks>
given:
- { <source columns with example values> }
expect:
- { <destination-facing columns, after field_mappings/mask> }
given uses the sync's source column names; expect uses the destination-facing
names (after the rename and the mask both run) — see docs/guides/sync-unit-tests.md for the
full ordering rule. Optional, not generated by default — offer it, and skip silently if the
user declines or the sync has no transforms worth verifying offline. If accepted, add to the
command list from step 4:
drt test --unit --select <name> # verify the transform, before ever touching the destination
type: bearer + token_env (never hardcode tokens)on_error: skip for Slack/webhooks, on_error: fail for critical syncscursor_fieldtype: sqs), install drt-core[sqs] and set queue_url_env. Delivery appends messages in full, incremental, or upsert; replace/mirror are unsupported. A resolved URL ending in .fifo requires message_group_id_field; deduplication_id_field is optional only with queue content-based deduplication. Standard queues reject both fields. FIFO IDs must be 1–128 ASCII letters, digits, or punctuation. Use SQL ORDER BY for per-group order and idempotent consumers for at-least-once delivery. Destination retry/rate_limit override sync settings; pacing is shared per resolved queue URL. See docs/connectors/sqs.md.type: pipedrive), set api_token_env (default PIPEDRIVE_API_TOKEN); only object: person is supported. Each row is looked up with an exact search on match_field (email, name or phone) and then updated or created; more than one match is a row error. match_policy: update_only|create_only is supported; replace/mirror are unsupported. Columns other than name, owner_id, org_id, visible_to, label_ids, email and phone go to custom_fields, so rename them to Pipedrive's 40-character field keys with sync.field_mappings. Each row costs about 25 API tokens (search 20 + write 5). See docs/connectors/pipedrive.md.mode: upsert|mirror, omit cursor_field, and include a destination upsert_keyref('table_name') when the source is a single DWH table; raw SQL when filtering or joining{{ row.<column_name> }} — column names must come from the userSee docs/llm/API_REFERENCE.md for all fields, types, and defaults.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub drt-hub/drt --plugin drt6 skills in this plugin
/drt-debugDebug and fix a failing drt sync. Use this skill whenever a user reports errors running drt, asks why a sync is failing, or needs to diagnose drt configuration problems (auth errors, rate limits, template errors, etc.).
/drt-initGuide a user through initializing a new drt project. Use this skill when a user is setting up drt for the first time, asks how to get started with drt, or needs help configuring their data warehouse connection.
/drt-migrateHelp migrate from Census, Hightouch, Polytomic, or custom scripts to drt. Use this skill when a user wants to replace their existing Reverse ETL tool with drt, or asks how to replicate a sync they had in another tool.
/drt-review-syncReview what a drt sync is about to change and apply it only after a human approves. Use this skill whenever a user asks to preview, review, approve or safely apply a sync, especially one that deletes rows (mirror/replace), updates many records, or writes to a production CRM. Uses drt_plan / drt_apply (MCP) or `drt plan` / `drt apply` (CLI).
/drt-troubleshootWalk a drt setup through a full top-to-bottom diagnostic checklist when something is off but the failing layer isn't obvious. Use this when a user says "drt isn't working", a sync silently does nothing, results look wrong, or they want to verify a fresh setup end-to-end — broader than /drt-debug, which fixes a specific known error.
Other plugins' skills for the same job