本文へスキップ
Skillpedia
分析とスプレッドシート48k · #5249

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に貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/monte-carlo-validation-notebook/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“'sales'と'customers'モデルについて、GitHubのPR変更 [PR URL] 用のSQL検証ノートブックを作成してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、データプロジェクトの変更(GitHubのリンクまたはローカルマシンから)を分析し、具体的なSQLクエリを生成します。生成されたクエリは、結果を確認できる対話型ノートブックを開くリンクにまとめられます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Tip: This skill works well with Sonnet. Run /model sonnet before 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 to https://getmontecarlo.com
  • Models (optional): --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.

Setup

Prerequisites:

  • gh (GitHub CLI) — required for PR mode. Must be authenticated (gh auth status).
  • python3 — 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.

Mode Detection

Auto-detect mode from the target argument:

  • If target looks like a URL (contains :// or github.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 text parameters (prod_db and dev_db) for selecting databases
  • Schema Inference: Automatically infers schema per model from dbt_project.yml and 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.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5249
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル