ワンクリックで
dbt-debugging
// Load when dbt run or dbt parse fails. Covers YML duplicate patches, ref errors, passthrough model warnings, current_date fixes, DuckDB error messages, and zero-row diagnosis.
// Load when dbt run or dbt parse fails. Covers YML duplicate patches, ref errors, passthrough model warnings, current_date fixes, DuckDB error messages, and zero-row diagnosis.
Gather business context from Notion before dbt builds. Searches pages, extracts definitions/decisions/constraints, writes structured context for the build agent and notion-verify subagent.
Load at Step 1 before exploring the project. Covers Notion context gathering, output shape inference, incremental model handling, and what to trust in YML.
Load at Step 4 when writing SQL models. Covers column naming, type preservation, JOIN defaults, lookup joins, sibling models, materialization, packages, and filtering rules.
Load when hitting DuckDB syntax errors or writing DuckDB-specific SQL. Covers gotchas that differ from PostgreSQL/MySQL.
BigQuery-specific SQL patterns: UNNEST for array expansion, STRUCT, ARRAY_AGG, DATE_DIFF/DATE_ADD, backtick-quoted table references, EXCEPT/REPLACE in SELECT, approximate aggregation, partitioned and wildcard tables.
Use this skill before writing any SQL query. Covers: output shape inference (cardinality clues from the question), efficient schema exploration, iterative CTE-based query building, structured verification loop (row count, NULL audit, fan-out check, sample inspection), error recovery protocol, saving output to result.sql and result.csv, turn budget management, and common benchmark traps.
| name | dbt-debugging |
| description | Load when dbt run or dbt parse fails. Covers YML duplicate patches, ref errors, passthrough model warnings, current_date fixes, DuckDB error messages, and zero-row diagnosis. |
| type | skill |
dbt fails with "Duplicate patch" when the same model appears in multiple YML files. Fix in ONE pass:
models/**/*.yml to find all YML filesschema.yml (which typically only has tests)If Compilation Error: node not found for ref():
SELECT table_name FROM information_schema.tables WHERE table_name = 'name'{{ config(materialized='ephemeral') }}
select * from main.<name>
{{ ref('name') }} with main.name directlyNEVER create .sql files named after raw tables (e.g. circuits.sql, results.sql).
This DESTROYS source data by replacing it with a materialized model.
Fix: add schema: main to the source definition in YML instead.
If dbt_project_map warns about current_date usage:
get_date_boundaries — find the column marked "USE THIS"current_date/now() with (SELECT MAX(<col>) FROM {{ ref('<table>') }})models/<name>.sql, paste full SQL, replace current_dateIf dbt_project_map warns about ROW_NUMBER/RANK:
dbt run --select <model>| Error | Fix |
|---|---|
invalid date field format | STRPTIME(col, '%d/%m/%Y')::DATE |
Table does not exist | Check actual names with describe_table |
column not found | Check exact names — case matters in DuckDB |
Cannot mix TIMESTAMP and INTEGER | Cast both args to same type |
No function matches DOUBLE / VARCHAR | Add explicit CAST() |
fivetran_utils is undefined | Run dbt deps (only if packages.yml exists) |
Binary search: comment out WHERE clauses and JOINs one at a time to find which condition drops all rows. Most common cause: INNER JOIN where LEFT JOIN is needed.
SELECT join_key, COUNT(*) FROM right_table GROUP BY 1 HAVING COUNT(*) > 1SELECT DISTINCT (if valid for the grain)ROW_NUMBER() dedup pattern