Skip to content
Data
Skill

/dbt-date-spines

- `dbt_project_map` reports "WARNING: Models use current_date" - `dbt run` produces far more rows than expected in a date-spine model

BOOST
From plugin
signalpilot
48728 skills2 agents
Install
$ npx -y skills add signalpilot-labs/signalpilot --skill dbt-date-spines --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/dbt-date-spines

Context preview

The summary Claude sees to decide when to auto-load this skill.

- `dbt_project_map` reports "WARNING: Models use current_date" - `dbt run` produces far more rows than expected in a date-spine model

SKILL.md

dbt-date-spines.SKILL.md
name: dbt-date-spines
type: skill

dbt Date Spine Hazard — Fixing current_date in Model Files

When This Applies

  • `dbt_project_map` reports "WARNING: Models use current_date"
  • `dbt run` produces far more rows than expected in a date-spine model

These are pre-shipped model SQL files in `models/` — you have direct write access. For general date spine syntax, see `duckdb-sql` skill section 2.

Fix Pattern

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.

Package Model Override

If the flagged file is in `dbt_packages/` (marked "PACKAGE MODEL" in the warning): 1. Read the full SQL from the package model file 2. Create `models/<same_filename>.sql` — dbt prioritizes local models over package models 3. Paste the entire package SQL into the new file and replace `current_date` with the data-driven endpoint 4. Add `{{ config(materialized='table') }}` at the top

Example: 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.

Finding the Right Date

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.

Verification

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.

Read more
Ships withsignalpilot
Get the whole plugin
Stats
487
Stars
27
Forks
Active
Maintenance
Python
Language
Apache-2.0
License
17d ago
Last commit
6mo ago
Created
4h ago
Added

Repo: signalpilot-labs/signalpilot

Other skills on signalpilot.