bigquery-sql
BigQuery-specific SQL patterns: UNNEST for array expansion, STRUCT, ARRAY_AGG, DATE_DIFF/DATE_ADD, backtick-quoted table…
Load when task involves dbt snapshots, SCD Type 2, or tracking data changes over time. Covers strategy selection, column casing, verification, and common pitfalls.
Claude Code
$ npx -y skills add signalpilot-labs/signalpilot --skill dbt-snapshots --agent claude-code
Codex
$ npx skills add signalpilot-labs/signalpilot --skill dbt-snapshots -a codex -y
Cursor
$ npx skills add signalpilot-labs/signalpilot --skill dbt-snapshots -a cursor -y
Gemini CLI
$ npx skills add signalpilot-labs/signalpilot --skill dbt-snapshots -a gemini-cli -y
GitHub Copilot
$ npx skills add signalpilot-labs/signalpilot --skill dbt-snapshots -a github-copilot -y
OpenCode
$ npx skills add signalpilot-labs/signalpilot --skill dbt-snapshots -a opencode -y
Windsurf
$ npx skills add signalpilot-labs/signalpilot --skill dbt-snapshots -a windsurf -y
name: dbt-snapshots description: "Load when task involves dbt snapshots, SCD Type 2, or tracking data changes over time. Covers strategy selection, column casing, verification, and common pitfalls." disable-model-invocation: false allowed-tools: Bash(dbt *)
Place snapshot files in `snapshots/`, NOT `models/`. Verify `snapshot-paths: ["snapshots"]` exists in `dbt_project.yml`.
**Choose the strategy BEFORE writing the snapshot file.**
Query the candidate timestamp column first:
SELECT COUNT(DISTINCT updated_at), MIN(updated_at), MAX(updated_at) FROM my_source_table
| Condition | Strategy | |-----------|----------| | `updated_at` has changing, meaningful values | `strategy='timestamp'`, `updated_at='UPDATED_AT'` | | `updated_at` frozen at a single constant value (COUNT(DISTINCT)=1) | `strategy='check'`, `check_cols='all'` - a column stuck at one value will never detect changes | | No `updated_at` column at all | `strategy='check'`, `check_cols='all'` |
Default to `strategy='check'` with `check_cols='all'` when uncertain - it always works.
Do NOT rationalize a frozen timestamp as valid business data. `1980-01-01` on every row is a data quality artifact, not a real date.
Snapshot `unique_key`, `updated_at`, and `check_cols` must match the EXACT case of the source columns.
Query column names before writing the config:
DESCRIBE my_source_table
Wrong: `unique_key='id'` when the source column is `ID`. Right: `unique_key='ID'`.
DuckDB and Snowflake snapshot configs are case-sensitive. A casing mismatch silently produces zero change detection.
SELECT explicit columns - not `SELECT *`. Include only business columns. Use raw source column names - do NOT alias them (e.g., `SELECT ID`, not `SELECT ID AS HOST_ID`). The snapshot output columns must match the source for `unique_key` and `check_cols` to work.
{% snapshot snap__employees %}
{{
config(
target_schema='main',
unique_key='EMPLOYEE_ID',
strategy='check',
check_cols='all'
)
}}
SELECT EMPLOYEE_ID, DEPARTMENT, TITLE, SALARY
FROM {{ source('hr', 'employees') }}
{% endsnapshot %}Set `target_schema` to the project's default schema (`'main'` for DuckDB).
Query actual column values before writing predicates:
SELECT DISTINCT IS_ACTIVE FROM my_source_table LIMIT 10
Getting this wrong silently filters to zero rows.
Run `dbt snapshot` - not `dbt run`. `dbt run` ignores snapshot files.
If the task involves tracking changes over time, run `dbt snapshot` once per mutation phase. A single run captures only the initial state.
After `dbt snapshot`, verify history was captured:
SELECT COUNT(*) AS total, COUNT(DISTINCT EMPLOYEE_ID) AS distinct_keys FROM main.snap__employees
Also verify SCD2 columns exist: `dbt_valid_from`, `dbt_valid_to`, `dbt_scd_id`, `dbt_updated_at`.
Reference snapshots like any model: `{{ ref('snap__employees') }}`.
BigQuery-specific SQL patterns: UNNEST for array expansion, STRUCT, ARRAY_AGG, DATE_DIFF/DATE_ADD, backtick-quoted table…
Load when dbt run or dbt parse fails. Covers YML duplicate patches, ref errors, passthrough model warnings, current_date fixes,…
Populate the knowledge base from dbt project research. Proposes entries across all 6 categories at org, project, and connection…
Load when task involves adding, writing, or fixing dbt unit tests. Covers unit_tests YAML format, given/expect blocks, edge-case…
Load when task involves dbt model versioning, creating v2 of a model, or backward-compatible model changes. Covers versions YAML…
Load at Step 1 before exploring the project. Covers output shape inference, incremental model handling, and what to trust in YML.
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…