con un clic
dbt-date-spines
// Fix current_date/now() hazards in dbt date spine models. Replaces nondeterministic date references with data-driven boundaries from get_date_boundaries.
// Fix current_date/now() hazards in dbt date spine models. Replaces nondeterministic date references with data-driven boundaries from get_date_boundaries.
BLOCKING REQUIREMENT: If the user's message mentions dbt, SQL, database, or data pipeline — invoke this skill as your FIRST tool call, BEFORE Read, Glob, Grep, Bash, or Agent. Covers: SignalPilot MCP tools, available skills, and the governed workflow for dbt projects, SQL queries, schema discovery, and database access.
Load FIRST before any dbt project work. Covers the full 5-step dbt workflow: project scanning, mapping, validation, contract understanding, SQL writing, and verification. Also covers output shape inference, incremental model handling, and what to trust in YML.
Gather business context from Notion before dbt builds. Searches all configured integrations, extracts definitions/decisions/constraints, writes structured context for the build agent and notion-verify subagent.
| name | dbt-date-spines |
| description | Fix current_date/now() hazards in dbt date spine models. Replaces nondeterministic date references with data-driven boundaries from get_date_boundaries. |
| type | skill |
dbt_project_map reports "WARNING: Models use current_date"dbt run produces far more rows than expected in a date-spine modelThese are pre-shipped model SQL files in models/ — you have direct write access.
For general date spine syntax, see duckdb-sql skill section 2.
Edit the model SQL directly. Replace current_date/current_timestamp/now() with a data-driven endpoint — a subquery from the primary fact table:
-- Before: ... CURRENT_DATE ...
-- After: ... (SELECT MAX(order_date) FROM {{ ref('stg_orders') }}) ...
Use the fact table with the most rows, or the one referenced in the task instruction.
If the flagged file is in dbt_packages/ (marked "PACKAGE MODEL" in the warning):
models/<same_filename>.sql — dbt prioritizes local models over package modelscurrent_date with the data-driven endpoint{{ config(materialized='table') }} at the topExample: if dbt_packages/shopify_source/models/stg_shopify__order.sql uses current_date:
-- models/stg_shopify__order.sql (local override — copy ENTIRE package SQL here)
{{ config(materialized='table') }}
-- Replace current_date with a data-driven endpoint:
-- (SELECT MAX(order_date) FROM {{ ref('stg_orders') }})
Do NOT edit files inside dbt_packages/ directly — dbt deps will overwrite your changes.
Call mcp__signalpilot__get_date_boundaries(connection_name="<id>").
Use the primary fact table's max date (marked "USE THIS"). Never use the global max — dimension tables often have later dates.
dbt run --select <model_name>
SELECT MIN(date_col), MAX(date_col), COUNT(*) FROM <model_name>
The spine's max date must match the source data's endpoint, not today's date.