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

From plugin
signalpilot
48928 skills2 agents

Claude Code

$ npx -y skills add signalpilot-labs/signalpilot --skill dbt-date-spines --agent claude-code

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
@signalpilot-labs
Ships withsignalpilot
48928 skills2 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
489
Star history of signalpilot-labs/signalpilot on GitHub, a chart by star-history.com

Other skills on signalpilot.

dbt-testing

dbt-testing

Load when task involves adding, writing, or fixing dbt unit tests. Covers unit_tests YAML format, given/expect blocks, edge-case…

More skills from other plugins.

paddleocr-doc-parsing

paddleocr-doc-parsing

Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…

paddleocr2mo93k
@paddlepaddle@paddlepaddleInstall Skill
context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem02w69k
@mem0ai@mem0aiInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

posthog3w41k
@posthog@posthogInstall Skill

Questions about dbt-date-spines.

Which coding agents can use dbt-date-spines?
dbt-date-spines installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.