What problem does it solve?
When writing or modifying dbt model SQL, it is easy to produce semantically wrong queries: correlated subqueries that recompute values per row, recomputed metrics that diverge from existing definitions, implicit joins that silently fan out rows, and select * statements that break when upstream models change. This Skill encodes the SQL semantic-correctness rules that prevent those mistakes.
Core Features & Use Cases
- Reuse before re-deriving: Checks existing dimensions and metrics on a model and composes them instead of writing new SQL that recomputes the same value.
- CTE pipeline structure: Structures queries as named CTEs referenced in sequence, banning correlated subqueries and preferring aggregated CTE joins.
- Explicit joins and columns: Enforces stated join types with
on conditions and named column lists so upstream changes cannot silently alter model output.
- Use Case: When asked to add an average order value metric to a model that already has
total_revenue and order_count, the Skill composes the two existing metrics rather than writing a fresh subquery against raw rows.
Quick Start
Ask the assistant to add a new metric or modify the SQL of a dbt model, and it will apply these semantic rules while matching the repo's existing conventions.