Generates SQL validation notebooks for dbt PR changes with before/after comparison queries.
Tip: This skill works well with Sonnet. Run
/model sonnetbefore invoking for faster generation.
Generate a SQL Notebook with validation queries for dbt changes.
Arguments: $ARGUMENTS
Parse the arguments:
--mc-base-url <URL> — defaults to https://getmontecarlo.com--models <model1,model2,...> — comma-separated list of model filenames (without .sql extension) to generate queries for. Only these models will be included. By default, all changed models are included up to a maximum of 10.Prerequisites:
gh (GitHub CLI) — required for PR mode. Must be authenticated ().gh auth statuspython3 — required for helper scripts.pyyaml — install with pip3 install pyyaml (or pip install pyyaml, uv pip install pyyaml, etc.)Note: Generated SQL uses ANSI-compatible syntax that works across Snowflake, BigQuery, Redshift, and Athena. Minor adjustments may be needed for specific warehouse quirks.
This skill includes two helper scripts in ${CLAUDE_PLUGIN_ROOT}/skills/monte-carlo-validation-notebook/scripts/:
resolve_dbt_schema.py - Resolves dbt model output schemas from dbt_project.yml routing rules and model config overrides.generate_notebook_url.py - Encodes notebook YAML into a base64 import URL and opens it in the browser.Auto-detect mode from the target argument:
:// or github.com) -> PR mode., /path/to/repo, relative path) -> Local modeThis command generates a SQL Notebook containing validation queries for dbt changes. The notebook can be opened in the MC Bridge SQL Notebook interface for interactive validation.
The output is an import URL that opens directly in the notebook interface:
<MC_BASE_URL>/notebooks/import#<base64-encoded-yaml>
Key Features:
text parameters (prod_db and dev_db) for selecting databasesdbt_project.yml and model configs{{prod_db}}.<SCHEMA>.<TABLE>{{prod_db}} vs {{dev_db}}Key structure: