dbt-versioning

Automate dbt model versioning with versions blocks and ref() resolution.

475|25|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/SignalPilot-Labs/SignalPilot --skill dbt-versioning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-versioning
Source: https://github.com/SignalPilot-Labs/SignalPilot/tree/main/benchmark/signalpilot-plugin/skills/dbt-versioning
Command: npx skills add https://github.com/SignalPilot-Labs/SignalPilot --skill dbt-versioning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Versioning dbt models to prevent downstream breakages when introducing v2 changes, ensuring clear distinction between versions and consistent references.

Core Features & Use Cases

  • Supports a versions: YAML block inside models to declare v1, v2, etc., and map defined_in to specific SQL files.
  • Controls latest_version to determine which version a bare ref('model') resolves to, while allowing ref('model', v=2) for explicit pinning.
  • Enables safe, backward-compatible model evolution in complex dbt projects.

Quick Start

Create a v2 for an existing model by enabling the versions YAML, adding the model_v2.sql file, and setting latest_version to 2, then use ref('model_name') to point to the desired version.

Frequently Asked Questions about dbt-versioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I version dbt models to prevent downstream breakages?

Version dbt models by declaring a versions YAML block inside your model, mapping versions to distinct SQL files via defined_in, and using versioned ref() calls to ensure stable v1 and v2 compatibility. This allows downstream models to pin to a specific model version safely.

How does latest_version affect ref() resolution in dbt-core?

The latest_version setting determines which version a bare ref('model') resolves to, while allowing explicit ref('model', v=2) calls for pinning. This mechanism controls backward-compatible model evolution by directing default references to the designated version.

What is the best way to create a v2 for an existing dbt model?

To create a v2 for an existing dbt model, enable the versions YAML configuration, add a new model_v2.sql file, and set latest_version to 2. Downstream models can then use ref('model_name') or explicit versioned refs to point to the desired version.

Do I need specific file naming conventions for dbt model versioning?

Yes, dbt model versioning enforces YAML versions configuration and file naming conventions to map versions to specific SQL files. Using the defined_in property within the versions block ensures dbt-core correctly resolves each version to its corresponding SQL file.

Can I maintain stable v1 and v2 compatibility simultaneously in dbt?

Yes, you can maintain stable v1 and v2 compatibility by leveraging the versions YAML block to define multiple model versions. Downstream models can independently pin to v1 or v2 using explicit ref() semantics, preventing breakages during model evolution.

Why does my bare dbt ref() point to the wrong model version?

A bare dbt ref() resolves to the version specified in the latest_version field of the YAML configuration. If it points to the wrong version, you need to check and update the latest_version setting or use an explicit ref('model', v=1) call to pin to the desired version.