jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ MonteCarlo監視Creation

monte-carlo-monitor-creation

MCPツールを活用し、モンテカルロシミュレーションの監視設定をCI/CDで展開可能なYAMLコードとして自動生成するSkill。

⏱ MCPサーバー実装 1日 → 2時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Guides creation of Monte Carlo monitors via MCP tools, producing monitors-as-code YAML for CI/CD deployment.

🇯🇵 日本人クリエイター向け解説

一言でいうと

MCPツールを活用し、モンテカルロシミュレーションの監視設定をCI/CDで展開可能なYAMLコードとして自動生成するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o monte-carlo-monitor-creation.zip https://jpskill.com/download/3176.zip && unzip -o monte-carlo-monitor-creation.zip && rm monte-carlo-monitor-creation.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3176.zip -OutFile "$d\monte-carlo-monitor-creation.zip"; Expand-Archive "$d\monte-carlo-monitor-creation.zip" -DestinationPath $d -Force; ri "$d\monte-carlo-monitor-creation.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して monte-carlo-monitor-creation.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → monte-carlo-monitor-creation フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
6

💬 こう話しかけるだけ — サンプルプロンプト

  • Monte Carlo Monitor Creation を使って、最小構成のサンプルコードを示して
  • Monte Carlo Monitor Creation の主な使い方と注意点を教えて
  • Monte Carlo Monitor Creation を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] monte-carlo-monitor-creation

Monte Carloモニター作成スキル

このスキルは、MCPを介してMonte Carloモニターを正しく作成する方法を教えます。すべての作成ツールはドライランモードで実行され、 monitors-as-code (MaC) YAMLを返します。モニターは直接作成されません。ユーザーはMonte Carlo CLIまたはCI/CDを介してYAMLを適用します。

参照ファイルはこのスキルファイルの隣にあります。それらにアクセスするには、Readツールを使用してください(MCPリソースではありません)。

  • メトリックモニターの詳細: references/metric-monitor.md (このファイルからの相対パス)
  • バリデーションモニターの詳細: references/validation-monitor.md (このファイルからの相対パス)
  • カスタムSQLモニターの詳細: references/custom-sql-monitor.md (このファイルからの相対パス)
  • 比較モニターの詳細: references/comparison-monitor.md (このファイルからの相対パス)
  • テーブルモニターの詳細: references/table-monitor.md (このファイルからの相対パス)

このスキルをアクティブにするタイミング

ユーザーが以下のいずれかの場合にアクティブにしてください。

  • モニターの作成、追加、または設定を依頼する(例:「〜のモニターを追加して」、「〜の鮮度チェックを作成して」、「〜のバリデーションを設定して」)
  • 特定のテーブル、フィールド、またはメトリックの監視について言及する
  • データ品質ルールをチェックしたい、またはデータ契約を強制したい
  • テーブルまたはデータセットの監視オプションについて尋ねる
  • monitors-as-code YAMLの生成を要求する
  • 新しい変換ロジックの後に監視を追加したい(preventスキルがアクティブでない場合)

このスキルをアクティブにしないタイミング

ユーザーが以下のいずれかの場合にはアクティブにしないでください。

  • 単にデータをクエリしている、またはテーブルの内容を探索している
  • アクティブなアラートをトリアージしている、または対応している(preventスキルのWorkflow 3を使用してください)
  • コード変更前に影響評価を実行している(preventスキルのWorkflow 4を使用してください)
  • 既存のモニター設定について尋ねている(getMonitorsを直接使用してください)
  • 既存のモニターを編集または削除している

利用可能なMCPツール

すべてのツールはmonte-carlo MCPサーバーを介して利用できます。

ツール 目的
testConnection 開始前に認証と接続を確認する
search 名前でテーブル/アセットを検索する。列にはinclude_fieldsを使用する
getTable スキーマ、統計、メタデータ、ドメインメンバーシップ、機能
getValidationPredicates ウェアハウスで利用可能なバリデーションルールタイプをリスト表示する
getDomains MCドメインをリスト表示する(テーブルにドメイン情報がない場合にのみ必要)
createMetricMonitorMac メトリックモニターYAMLを生成する(ドライラン)
createValidationMonitorMac バリデーションモニターYAMLを生成する(ドライラン)
createComparisonMonitorMac 比較モニターYAMLを生成する(ドライラン)
createCustomSqlMonitorMac カスタムSQLモニターYAMLを生成する(ドライラン)
createTableMonitorMac テーブルモニターYAMLを生成する(ドライラン)

モニターの種類

タイプ ツール 使用するタイミング
Metric createMetricMonitorMac フィールドの統計メトリック(null率、ユニークカウント、数値統計)または行数変更を時系列で追跡します。集計にはタイムスタンプフィールドが必要です。
Validation createValidationMonitorMac 条件付きの行レベルのデータ品質チェック(例:「フィールドXはnullではない」、「ステータスは許可されたセット内にある」)。INVALIDデータに対してアラートを発します。
Custom SQL createCustomSqlMonitorMac 単一の数値を返す任意のSQLを実行し、しきい値でアラートを発します。最も柔軟で、他のタイプが合わない場合に使用します。
Comparison createComparisonMonitorMac 2つのテーブル間のメトリックを比較します(例:devとprod、ソースとターゲット)。
Table createTableMonitorMac 鮮度、スキーマ変更、ボリュームについてテーブルのグループを監視します。データベース/スキーマレベルでのアセット選択を使用します。

手順

以下の手順を順番に実行してください。手順を飛ばさないでください。

バリデーションフェーズ(ステップ1-3) -- 作成ツールを呼び出す前に完了必須

最も多いエラーパターンは、エージェントがバリデーションをスキップし、推測または不完全なパラメーターで作成ツールを呼び出すことです。作成呼び出しのすべてのフィールドは、このフェーズで取得されたデータに基づいている必要があります。 ステップ1-3が完全に満たされるまで、ステップ4に進まないでください。

ステップ1:リクエストを理解する

自問自答してください。

  • ユーザーは何を監視したいですか?(特定のテーブル、メトリック、データ品質ルール、テーブル間の整合性、スキーマレベルでの鮮度/ボリューム)
  • どのモニタータイプが適していますか?上記のモニタータイプテーブルを使用してください。
  • ユーザーはすべての詳細を持っていますか、それともガイダンスが必要ですか?

ユーザーの意図が不明確な場合は、続行する前に焦点を絞った質問をしてください。

ステップ2:テーブルと列を特定する

テーブルMCONがない場合:

  1. テーブル名とinclude_fields: ["field_names"]を使用してsearchを呼び出し、MCONを見つけて列名を取得します。
  2. ユーザーがdatabase:schema.tableのような完全なテーブルIDを提供した場合、それを検索します。
  3. MCONを取得したら、getTableinclude_fields: trueinclude_table_capabilities: trueで呼び出し、機能を確認し、ドメイン情報を取得します。

すでにMCONがある場合:

  1. MCON、include_fields: true、およびinclude_table_capabilities: truegetTableを呼び出します。

重要:getTableの結果から実際の列名が必要です。列名を推測したり、幻覚を起こしたりしないでください。 これはモニター作成失敗の最も一般的な原因です。

タイムスタンプ列を必要とするモニタータイプ(メトリックモニター)の場合、列名を確認し、可能性のあるt

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Monte Carlo Monitor Creation Skill

This skill teaches you to create Monte Carlo monitors correctly via MCP. Every creation tool runs in dry-run mode and returns monitors-as-code (MaC) YAML. No monitors are created directly -- the user applies the YAML via the Monte Carlo CLI or CI/CD.

Reference files live next to this skill file. Use the Read tool (not MCP resources) to access them:

  • Metric monitor details: references/metric-monitor.md (relative to this file)
  • Validation monitor details: references/validation-monitor.md (relative to this file)
  • Custom SQL monitor details: references/custom-sql-monitor.md (relative to this file)
  • Comparison monitor details: references/comparison-monitor.md (relative to this file)
  • Table monitor details: references/table-monitor.md (relative to this file)

When to activate this skill

Activate when the user:

  • Asks to create, add, or set up a monitor (e.g. "add a monitor for...", "create a freshness check on...", "set up validation for...")
  • Mentions monitoring a specific table, field, or metric
  • Wants to check data quality rules or enforce data contracts
  • Asks about monitoring options for a table or dataset
  • Requests monitors-as-code YAML generation
  • Wants to add monitoring after new transformation logic (when the prevent skill is not active)

When NOT to activate this skill

Do not activate when the user is:

  • Just querying data or exploring table contents
  • Triaging or responding to active alerts (use the prevent skill's Workflow 3)
  • Running impact assessments before code changes (use the prevent skill's Workflow 4)
  • Asking about existing monitor configuration (use getMonitors directly)
  • Editing or deleting existing monitors

Available MCP tools

All tools are available via the monte-carlo MCP server.

Tool Purpose
testConnection Verify auth and connectivity before starting
search Find tables/assets by name; use include_fields for columns
getTable Schema, stats, metadata, domain membership, capabilities
getValidationPredicates List available validation rule types for a warehouse
getDomains List MC domains (only needed if table has no domain info)
createMetricMonitorMac Generate metric monitor YAML (dry-run)
createValidationMonitorMac Generate validation monitor YAML (dry-run)
createComparisonMonitorMac Generate comparison monitor YAML (dry-run)
createCustomSqlMonitorMac Generate custom SQL monitor YAML (dry-run)
createTableMonitorMac Generate table monitor YAML (dry-run)

Monitor types

Type Tool Use When
Metric createMetricMonitorMac Track statistical metrics on fields (null rates, unique counts, numeric stats) or row count changes over time. Requires a timestamp field for aggregation.
Validation createValidationMonitorMac Row-level data quality checks with conditions (e.g. "field X is never null", "status is in allowed set"). Alerts on INVALID data.
Custom SQL createCustomSqlMonitorMac Run arbitrary SQL returning a single number and alert on thresholds. Most flexible; use when other types don't fit.
Comparison createComparisonMonitorMac Compare metrics between two tables (e.g. dev vs prod, source vs target).
Table createTableMonitorMac Monitor groups of tables for freshness, schema changes, and volume. Uses asset selection at database/schema level.

Procedure

Follow these steps in order. Do NOT skip steps.

Validation Phase (Steps 1-3) -- MUST complete before any creation tool is called

The number one error pattern is agents skipping validation and calling a creation tool with guessed or incomplete parameters. Every field in the creation call must be grounded in data retrieved during this phase. Do not proceed to Step 4 until Steps 1-3 are fully satisfied.

Step 1: Understand the request

Ask yourself:

  • What does the user want to monitor? (a specific table, a metric, a data quality rule, cross-table consistency, freshness/volume at schema level)
  • Which monitor type fits? Use the monitor types table above.
  • Does the user have all the details, or do they need guidance?

If the user's intent is unclear, ask a focused question before proceeding.

Step 2: Identify the table(s) and columns

If you don't have the table MCON:

  1. Use search with the table name and include_fields: ["field_names"] to find the MCON and get column names.
  2. If the user provided a full table ID like database:schema.table, search for it.
  3. Once you have the MCON, call getTable with include_fields: true and include_table_capabilities: true to verify capabilities and get domain info.

If you already have the MCON:

  1. Call getTable with the MCON, include_fields: true, and include_table_capabilities: true.

CRITICAL: You need the actual column names from getTable results. NEVER guess or hallucinate column names. This is the most common source of monitor creation failures.

For monitor types that require a timestamp column (metric monitors), review the column names and identify likely timestamp candidates. Present them to the user if ambiguous.

Step 3: Handle domain assignment

Monitors must be assigned to a domain that contains the table being monitored. The getTable response includes a domains list with uuid and name.

  1. If domains is empty: skip domain assignment.
  2. If domains has exactly one entry: default domain_id to that domain's UUID.
  3. If domains has multiple entries: present only those domains and ask the user to pick.

Do NOT present all account domains as options -- only domains that contain the table are valid.

ALWAYS check the table's domains BEFORE calling any creation tool.


Creation Phase (Steps 4-8)

Only enter this phase after the validation phase is complete with real data from MCP tools.

Step 4: Load the sub-skill reference

Based on the monitor type, read the detailed reference for parameter guidance:

  • Metric -- Read the detailed reference: references/metric-monitor.md (relative to this file)
  • Validation -- Read the detailed reference: references/validation-monitor.md (relative to this file)
  • Custom SQL -- Read the detailed reference: references/custom-sql-monitor.md (relative to this file)
  • Comparison -- Read the detailed reference: references/comparison-monitor.md (relative to this file)
  • Table -- Read the detailed reference: references/table-monitor.md (relative to this file)

Step 5: Ask about scheduling

Skip this step for table monitors. Table monitors do not support the schedule field in MaC YAML — adding it will cause a validation error on montecarlo monitors apply. Table monitor scheduling is managed automatically by Monte Carlo.

For all other monitor types, the creation tools default to a fixed schedule running every 60 minutes. Present these options:

  1. Fixed interval -- any integer for interval_minutes (30, 60, 90, 120, 360, 720, 1440, etc.)
  2. Dynamic -- MC auto-determines when to run based on table update patterns.
  3. Loose -- runs once per day.

Schedule format in MaC YAML:

  • Fixed: schedule: { type: fixed, interval_minutes: <N> }
  • Dynamic: schedule: { type: dynamic }
  • Loose: schedule: { type: loose, start_time: "00:00" }

Step 6: Confirm with the user

Before calling the creation tool, present the monitor configuration in plain language:

  • Monitor type
  • Target table (and columns if applicable)
  • What it checks / what triggers an alert
  • Domain assignment
  • Schedule

Ask: "Does this look correct? I'll generate the monitor configuration."

NEVER call the creation tool without user confirmation.

Step 7: Create the monitor

Call the appropriate creation tool with the parameters built in previous steps. Always pass an MCON when possible. If only table name is available, also pass warehouse.

Step 8: Present results

CRITICAL: Always include the YAML in your response. The user needs copy-pasteable YAML.

  1. If a non-default schedule was chosen, modify the schedule section in the YAML before presenting.
  2. Wrap the YAML in the full MaC structure (see "MaC YAML format" section below).
  3. ALWAYS present the full YAML in a ```yaml code block.
  4. Explain where to put it and how to apply it (see below).
  5. ALWAYS use ISO 8601 format for datetime values.
  6. NEVER reformat YAML values returned by creation tools.

MaC YAML format

The YAML returned by creation tools is the monitor definition. It must be wrapped in the standard MaC structure to be applied:

montecarlo:
  <monitor_type>:
    - <returned yaml>

For example, a metric monitor would look like:

montecarlo:
  metric:
    - <yaml returned by createMetricMonitorMac>

Important: montecarlo.yml (without a directory path) is a separate Monte Carlo project configuration file -- it is NOT the same as a monitor definition file. Monitor definitions go in their own .yml files, typically in a monitors/ directory or alongside dbt model schema files.

Tell the user:

  • Save the YAML to a .yml file (e.g. monitors/<table_name>.yml or in their dbt schema)
  • Apply via the Monte Carlo CLI: montecarlo monitors apply --namespace <namespace>
  • Or integrate into CI/CD for automatic deployment on merge

Common mistakes to avoid

  • NEVER guess column names. Always get them from getTable.
  • NEVER skip the confirmation step (Step 6).
  • For metric monitors, aggregate_time_field MUST be a real timestamp column from the table.
  • For validation monitors, conditions match INVALID data, not valid data.
  • Always pass an MCON when possible. If only table name is available, also pass warehouse.
  • ALWAYS check table's domains BEFORE calling any creation tool.
  • ALWAYS use ISO 8601 format for datetime values.
  • NEVER reformat YAML values returned by creation tools.
  • Do not call creation tools before the validation phase is complete.

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.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。