monte-carlo-validation-notebook
它能做什么
这个工具会创建一个 SQL 测试笔记本,用于检查数据的改动。它使用 SQL 查询,对比数据在改动前后的样子。
适用场景
- ✓在审查数据项目(dbt)的改动时。
- ✓当你想确认改动没有破坏任何东西时。
- ✓用于比较生产环境和开发环境之间的数据。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/monte-carlo-validation-notebook/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为 'sales' 和 'customers' 模型创建一个 SQL 验证笔记本,对应的 GitHub PR 改动为 [PR URL]。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会分析你数据项目中的改动(可以来自 GitHub 链接,也可以来自你的本地电脑),并生成具体的 SQL 查询。这些查询会被打包成一个链接,打开后是一个可交互的笔记本,供你查看结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use
Use this skill when the user wants to validate dbt model or snapshot changes with Monte Carlo SQL Notebook queries, either from a GitHub PR or a local dbt repository.
Parse the arguments:
- Target (required): first argument — a GitHub PR URL or local dbt repo path
- MC Base URL (optional):
--mc-base-url <URL>— defaults tohttps://getmontecarlo.com - Models (optional):
--models <model1,model2,...>— comma-separated list of model filenames (without.sqlextension) to generate queries for. Only these models will be included. By default, all changed models are included up to a maximum of 10.
Setup
Prerequisites:
gh(GitHub CLI) — required for PR mode. Must be authenticated (gh auth status).python3— required for helper scripts.pyyaml— install withpip3 install pyyaml(orpip 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 fromdbt_project.ymlrouting rules and model config overrides.generate_notebook_url.py- Encodes notebook YAML into a base64 import URL and opens it in the browser.
Mode Detection
Auto-detect mode from the target argument:
- If target looks like a URL (contains
://orgithub.com) -> PR mode - If target is a path (
.,/path/to/repo, relative path) -> Local mode
Context
This 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:
- Database Parameters: Two
textparameters (prod_dbanddev_db) for selecting databases - Schema Inference: Automatically infers schema per model from
dbt_project.ymland model configs - Single-table queries: Basic validation queries using
{{prod_db}}.<SCHEMA>.<TABLE> - Comparison queries: Before/after queries comparing
{{prod_db}}vs{{dev_db}} - Flexible usage: Users can set both parameters to the same database for single-database analysis
Notebook YAML Spec Reference
Key structure:
version: 1
metadata:
id: string # kebab-case + random suffix
name: string # display name
created_at: string # ISO 8601
updated_at: string # ISO 8601
default_context: # optional database/schema context
database: string
schema: string
cells:
- id: string
type: sql | markdown | parameter
content: string # SQL, markdown, or parameter config (JSON)
display_type: table | bar | timeseries
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题
需要安装什么吗?
需要。你的电脑上需要安装 GitHub CLI(gh)、Python 3 和 PyYAML 库。
生成的查询可以在哪里使用?
这些查询兼容 Snowflake、BigQuery、Redshift 和 Athena 等数据库。每个数据库可能需要做少量调整。
“prod_db”和“dev_db”参数是什么?
这是笔记本中的两个字段,让你可以选择用哪个数据库来对比“生产”和“开发”环境的数据。
详情
作者的原始描述
Generates SQL validation notebooks for dbt PR changes with before/after comparison queries.
热度
- GitHub 星标
- 48k
- 排名
- #5249
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。