Summary
Add a git pre-commit hook that checks staged .sql files for matching YAML property files.
Motivation
Developers can accidentally commit new SQL models without creating the companion YAML, bypassing contract enforcement entirely. A pre-commit check catches this before the commit lands.
Proposed behavior
- New SQL files: block the commit if no matching YAML exists; instruct the developer to create one first (via the dbt Core Tools extension's "Toggle SQL/Properties" command or manually)
- Modified SQL files: print a non-blocking reminder to run column sync if columns may have changed
Implementation
- Vanilla
.git/hooks/pre-commit shell script (not a Trunk action)
- Checks
properties/<model>.yml (or .yaml) relative to each staged SQL file
- Covers
extracts/ and staging/ model directories
References
Summary
Add a git pre-commit hook that checks staged
.sqlfiles for matching YAML property files.Motivation
Developers can accidentally commit new SQL models without creating the companion YAML, bypassing contract enforcement entirely. A pre-commit check catches this before the commit lands.
Proposed behavior
Implementation
.git/hooks/pre-commitshell script (not a Trunk action)properties/<model>.yml(or.yaml) relative to each staged SQL fileextracts/andstaging/model directoriesReferences
docs/superpowers/specs/2026-03-24-dbt-extract-yml-autogen-design.mdon branchcbini/feat/claude-dbt-extract-yml-autogen