dbt-schema-verify

Validates dbt model columns against schema.yml specifications after builds.

803|134|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/AltimateAI/altimate-code --skill dbt-schema-verify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-schema-verify
Source: https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills/dbt-schema-verify
Command: npx skills add https://github.com/AltimateAI/altimate-code --skill dbt-schema-verify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

A dbt build can succeed while the model produces the wrong column shape — extra columns, missing columns, wrong order, or wrong types — causing equality and existence tests to fail downstream. This Skill enforces a mechanical diff between the actual materialized columns and the columns declared in schema.yml or _models.yml before any model task is declared complete.

Core Features & Use Cases

  • Column Contract Verification: Runs altimate-dbt schema-verify --model <name> to produce a structured JSON verdict (match, mismatch, or no-spec) with four diff buckets: columns_extra, columns_missing, columns_reordered, and type_mismatches.
  • Mechanical Fix Guidance: Maps each diff bucket to a concrete SQL action — remove, add, reorder, or cast columns in the SELECT — then rebuild and re-verify until the verdict is match.
  • Manual Fallback: When the altimate-dbt CLI is unavailable, it describes how to diff expected columns from YAML specs against dbt show --select <name> --limit 0 output by hand.
  • Use Case: After refactoring a CTE into its own intermediate model, run schema-verify on every touched model to catch a silently dropped column before equality tests fail in CI.

Quick Start

Ask the agent to run altimate-dbt schema-verify on the dbt model you just built and fix any reported column mismatches.

Frequently Asked Questions about dbt-schema-verify

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

FAQPage Schema
How do I verify dbt model columns match schema.yml?

Run `altimate-dbt schema-verify --model <name>` after building the model. It returns a JSON verdict comparing expected columns from the YAML spec against actual warehouse columns, listing extra, missing, reordered, and type-mismatched columns.

Why do dbt equality tests fail when the build succeeds?

A green build only proves the SQL compiled and ran; it does not verify column shape. Equality tests grade the exact column tuple of name, type, and position, so extra, missing, or reordered columns cause failures that schema-verify detects.

Does dbt build already check column shape automatically?

Yes, `altimate-dbt build --model <name>` runs schema-verify automatically after a successful build and includes the verdict in a schema_verify field of its response. You only need to call schema-verify directly when re-checking after edits.

What should I do when schema-verify reports a mismatch?

Treat a mismatch verdict as not done. Remove extra columns from the SELECT, add missing ones, reorder columns to match the spec, or cast types, then rebuild and re-run schema-verify until the verdict is match.

Can I verify dbt schema without the altimate-dbt CLI?

Yes. Read the expected columns from the model's YAML spec under models/, then run `dbt show --select <name> --limit 0` to get actual columns, and manually diff the two ordered lists using the same four-bucket logic.

What does dbt schema-verify not check?

It only validates column shape, not value correctness, row counts, or custom business-rule tests. A model can pass schema-verify while failing value-level equality tests, so run dbt tests and row-count checks separately.