/senior-data-engineer:cdc-scd-patternsfrom senior-data-engineer
Guides CDC ingestion via Datastream and SCD modeling (Types 0-6) in BigQuery/Dataform. Covers bronze landing, deduplication, and idempotent MERGE statements for history-tracking dimension tables.
Ships in senior-data-engineer. 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.
Read when SKILL.md points to them; scripts run unread.
This skill guides the design and implementation of Change Data Capture (CDC) replication pipelines and Slowly Changing Dimension (SCD) modeling in Google Cloud BigQuery and Dataform. It acts as a Senior Data Engineer and Dimensional Modeling Specialist, ensuring accurate historical point-in-time tracking, idempotent MERGE statements, and clean transition from raw change logs to queryable dimension tables.
.sqlx models to deduplicate CDC event streams into current-state snapshots.gcp-data-engineering.bigquery-query-optimization.database-migration-expert._metadata_timestamp, _metadata_deleted, _metadata_change_type).| Type | Behavior | Business Use Case |
|---|---|---|
| Type 0 | Retain original value permanently. | Original signup timestamp, initial creation dates. |
| Type 1 | Overwrite in place; no history preserved. | Typo corrections, attributes where history has zero analytical value. |
| Type 2 | New row per change with valid_from, valid_to, is_current. | Default choice: Customer addresses, pricing tiers, account statuses. |
| Type 3 | Add previous_value column. | Tracking only the immediately prior state alongside current. |
| Type 4 | Separate current table and historical log table. | Extremely high-churn dimensions where current queries must remain fast. |
| Type 6 | Hybrid: Type 2 versioning with a Type 1 current column. | Fast lookups without self-joins while retaining full historical auditability. |
Scaffold the parameterized Dataform .sqlx model implementing atomic SCD Type 2 merge logic:
python3 ./skills/cdc-scd-patterns/scripts/scaffold_scd2_dataform.py <table_name> <key_column> <tracked_columns_comma_separated>
The script implements proper MERGE ... WHEN MATCHED logic, updates valid_to timestamps, and sets is_current = FALSE on superseded records in a single atomic transaction.
# Scaffold an SCD Type 2 Dataform model for a customer dimension
python3 ./skills/cdc-scd-patterns/scripts/scaffold_scd2_dataform.py dim_customer customer_id name,email,address,tier
scaffold_scd2_dataform.py in the workspace shell to generate SQLX models.= instead of IS DISTINCT FROM (treating NULL = NULL as NULL, missing changes).valid_to = current_timestamp, is_current = FALSE) when inserting a new version.python3 ./skills/cdc-scd-patterns/scripts/scaffold_scd2_dataform.py <table_name> <key_column> <tracked_columns>
IS DISTINCT FROM across all tracked columns.is_current = TRUE and valid_to IS NULL.For full SQL templates and production-ready merge queries:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cdc, scd, bigquery, dataform, datastream, dimensional-modeling
npx claudepluginhub jggomez/expert-ai-developer-skills --plugin senior-data-engineer4 skills in this plugin
/context-captureUse when finishing a task, or when asked to "save context", "guarda contexto", "record decisions" or "hand off": writes compact memory to context/memory/ and keeps the root AGENTS.md (at most 90 lines) linked to DESIGN.md and MEMORY.md for Claude Code and Google Antigravity./context-restoreUse at session start (State 0) or when asked to "load context", "catch up", or "what was done before" — prioritizes LLM Wiki Progressive Disclosure (context/memory/MEMORY.md) across Claude Code and Google Antigravity while supporting user-confirmed restore for scripted sessions (context/sessions/)./Other plugins' skills for the same job