dbt-migration-validation_skill

This skill validates dbt migrations by enforcing YAML and SQL rules, detects anti-patterns, and offers auto-fix suggestions to improve quality.
  • Python

26

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-migration-validation

  • SKILL.md12.9 KB

Overview

This skill provides comprehensive validation for dbt models and schema YAML files during migrations. It enforces validation rules, detects common anti-patterns, and offers auto-fix suggestions to keep models Snowflake-compatible and production-ready. It integrates with validation hooks to run checks automatically on edits and writes.

How this skill works

The skill inspects schema YAML and SQL model files to apply a ruleset for documentation, naming, tests, CTE structure, and Snowflake compatibility. It detects missing descriptions, absent primary/foreign key tests, SELECT * usage, hardcoded table references, and platform-specific syntax, then recommends concrete fixes. Validation runs via configured hooks and returns non-zero exit codes for errors while reporting warnings.

When to use it

  • During model migration from other platforms to Snowflake to catch incompatible syntax and breaking changes.
  • When reviewing pull requests to ensure models follow naming, testing, and documentation standards.
  • While diagnosing validation hook failures triggered on file edits or writes.
  • When configuring or enforcing team validation thresholds and automated checks.
  • To generate targeted auto-fix suggestions for common dbt anti-patterns.

Best practices

  • Always include model and column descriptions in schema YAML to improve docs and ownership.
  • Declare dbt_constraints.primary_key and relationship tests for key-like column names.
  • Use ref() and source() for all table references to preserve lineage and environment portability.
  • List explicit columns in final SELECTs; avoid SELECT * except from a final CTE that lists columns.
  • Follow layer-specific naming prefixes (stg_, int_, dim_, fct_) to make model intent clear.
  • Prefer standard CTE patterns and a config block with materialization for readability and consistency.

Example use cases

  • Validate a migrated SQL model to replace TOP/ISNULL/GETDATE() with Snowflake equivalents and add a migration header.
  • Scan schema YAML to add missing model descriptions and data_type declarations before releasing documentation.
  • Fail CI on critical errors like missing primary key tests or hardcoded table references.
  • Automatically run validators on file save to get immediate auto-fix suggestions for CTE structure or naming issues.
  • Generate a remediation checklist for large migration batches highlighting platform-specific fixes and breaking changes.

FAQ

Errors such as missing model descriptions, missing primary key tests, SELECT * in final output, hardcoded table references, or Snowflake-incompatible syntax will cause a non-zero exit code.

Are warnings treated the same as errors?

No. Warnings (for example, missing column descriptions or absent config blocks) are reported but do not cause the process to fail.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational