monte-carlo-data/mc-agent-toolkit/prevent
Claude Code and agent skill by monte-carlo-data/mc-agent-toolkit
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Shift-left safety net for dbt/SQL model edits. Runs change impact assessment before edits, generates SQL validation queries after, and executes them via `/mc-validate run`. Delegates health and monitor creation to peer skills.
Install
npx vskill@latest install monte-carlo-data/mc-agent-toolkit/preventSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as monte-carlo-data/mc-agent-toolkit/prevent.
Monte Carlo Prevent Skill
This skill brings Monte Carlo's data observability context directly into your editor. When you're modifying a dbt model or SQL pipeline, use it to surface table health, lineage, active alerts, and to generate monitors-as-code without leaving Claude Code.
Monte Carlo tool routing (required): For Monte Carlo operations such asget_alerts,searchandget_asset, use the tool ID your client exposes on the connection for the intended account.Proceed when there is one suitable connection and no evidence of an account or source mismatch. Ifthe choice is ambiguous, ask which connection to use before making a Monte Carlo call; if youcan't get an answer, leave the call pending. Use the selected connection throughout. If it isunavailable or lacks the operation, follow this skill's fallback where it has one, or report whatis missing.
<!-- plugin-only:start -->
With the Agent Toolkit plugin: When using the toolkit plugin or its installer, prefer theconnection it provides or configures (normally namedmonte-carlo-mcp) when it is suitable for theintended account. If you know that connection is missing, confirm the intended alternative beforeusing another one.
<!-- plugin-only:end -->
Reference files live next to this skill file. Use the Read tool (not MCP resources) to access them:
- Full workflow step-by-step instructions:
references/workflows.md(relative to this file) - MCP parameter details:
references/parameters.md(relative to this file) - Troubleshooting:
references/TROUBLESHOOTING.md(relative to this file)
When to activate this skill
Prevent is the edit-lifecycle skill. Activate only when the user expresses intent to change a dbt model. Bare file mentions, table-name mentions in passing, or general health questions are not prevent's territory — those belong to monte-carlo-asset-health and will activate that skill on their own.
Do not wait to be asked. Run the appropriate workflow automatically whenever the user:
- Describes a planned change to a model (new column, join update, filter change, refactor) → STOP — run Workflow 1 first if it has not run for this table this session, then Workflow 2, before writing any code
- Adds a new column, metric, or output expression to an existing model → same rule: Workflow 1 first (if not yet run for this table), then Workflow 2; the post-edit hook will offer Workflow 5 (monitor generation) afterward
- References a model file with an edit verb in the same prompt (e.g.
@models/clients/client_hub.sql add an is_active column) → same rule: Workflow 1 first, then Workflow 2
Present the W2 impact assessment as context the engineer needs before proceeding — not as a response to a question.
Workflow 1 runs silently when chained to Workflow 2
When the user expresses change intent, Workflow 1 invokes monte-carlo-asset-health purely as a data-gathering step. Read asset-health's report from your context, but do not relay the full report to the engineer — the user-facing artifact is Workflow 2's impact assessment, which already cites the relevant alerts / lineage / monitors. Showing both creates duplicate reading.
Two exceptions where you must surface output from W1 to the engineer:
- Disambiguation prompt. If asset-health returns multiple matches and asks
the engineer to pick one, surface that question — the user must choose.
- Stop-the-world signals. If the table is already on fire (active critical
alerts firing, freshness severely stale), say so in one short line before W2.
If Workflow 1 already ran for this table earlier in the session, skip directly to Workflow 2 — re-running asset-health is redundant.
When NOT to activate this skill
Do not invoke Monte Carlo tools for:
- Seed files (files in seeds/ directory)
- Analysis files (files in analyses/ directory)
- One-off or ad-hoc SQL scripts not part of a dbt project
- Configuration files (dbt_project.yml, profiles.yml, packages.yml)
- Test files unless the user is specifically asking about data quality
If uncertain whether a file is a dbt model, check for {{ ref() }} or {{ source() }} Jinja references — if absent, do not activate.
Macros and snapshots — gate edits, skip auto-context
Macro files (macros/) and snapshot files (snapshots/) are not models, so do not auto-fetch Monte Carlo context (Workflow 1) when they are opened. However, macros are inlined into every model that calls them at compile time — a one-line macro change can silently alter dozens of models. Snapshots control historical tracking and are similarly sensitive.
The pre-edit hook gates these files. If the hook fires for a macro or snapshot, identify which models are affected and run the change impact assessment (Workflow 2) for those models before proceeding with the edit.
Peer-skill redirects
These requests have their own skills — do not run prevent for them:
- "How is table X doing?" / "is X healthy?" / "check status of X" →
monte-carlo-asset-health - "Create a monitor for X" / "what should I monitor?" / "set up freshness on X" (without an active edit context) →
monte-carlo-monitoring-advisor
Prevent invokes asset-health and monitoring-advisor itself when its workflows need them (W1, W5); it does not duplicate their entry points.
REQUIRED: Change impact assessment before any SQL edit
Before editing or writing any SQL for a dbt model or pipeline, you MUST run Workflow 2.
This applies whenever the user expresses intent to modify a model — including phrases like:
- "I want to add a column…"
- "Let me add / I'm adding…"
- "I'd like to change / update / rename…"
- "Can you add / modify / refactor…"
- "Let's add…" / "Add a
<column>column" - Any other description of a planned schema or logic change
- "Exclude / filter out / remove [records/customers/rows]…"
- "Adjust / increase / decrease [threshold/parameter/value]…"
- "Fix / bugfix / patch [issue/bug]…"
- "Revert / restore / undo [change/previous behavior]…"
- "Disable / enable [feature/logic/flag]…"
- "Clean up / remove [references/columns/code]…"
- "Implement [backend/feature] for…"
- "Create [models/dbt models] for…" (when modifying existing referenced tables)
- "Increase / decrease / change [max_tokens/threshold/date constant/numeric parameter]…"
- Any change to a hardcoded value, constant, or configuration parameter within SQL
- "Drop / remove / delete [column/field/table]"
- "Rename [column/field] to [new name]"
- "Add [column]" (short imperative form, e.g. "add a created_at column")
- Any single-verb imperative command targeting a column, table, or model
(e.g. "drop X", "rename Y", "add Z", "remove W")
Parameter changes (threshold values, date constants, numeric limits) appear safe but silently change model output. Treat them the same as logic changes for impact assessment purposes.
Do not write or edit any SQL until the change impact assessment (Workflow 2) has been presented to the user. The assessment must come first — not after the edit, not in parallel.
Pre-edit gate — check before modifying any file
Before calling Edit, Write, MultiEdit, or apply_patch on any `.sql` or dbt model file, you MUST check:
- Has the synthesis step been run for THIS SPECIFIC CHANGE in the
current prompt?
- If YES → proceed with the edit, writing the completion marker first, and only
once the edit is going ahead (see Impact check complete)
- If NO → stop immediately, run Workflow 2, present the full
report with synthesis connected to this specific change. If risk is High or Medium: ask "Do you want me to proceed with the edit?" and wait for explicit confirmation. If risk is Low: use judgment — proceed if straightforward and no concerns found, otherwise ask before editing.
Important: "Workflow 2 already ran this session" is NOT sufficient to proceed. Each distinct change prompt requires its own synthesis step connecting the MC findings to that specific change.
The synthesis must reference the specific columns, filters, or logic being changed in the current prompt — not just general table health.
Example:
- ✅ "Given 34 downstream models depend on is_paying_workspace,
adding 'MC Internal' to the exclusion list will exclude these workspaces from all downstream health scores and exports. Confirm?"
- ❌ "Workflow 2 already ran. Making the edit now."
The only exception: if the user explicitly acknowledges the risk and confirms they want to skip (e.g. "I know the risks, just make the change") — proceed but note the skipped assessment.
Available MCP tools
All tools are available via the monte-carlo-mcp MCP server.
| Tool | Purpose | |
|---|---|---|
testConnection | Verify auth and connectivity | |
search | Find tables/assets by name | |
getTable | Schema, stats, metadata for a table | |
getAssetLineage | Upstream/downstream dependencies (call with mcons array + direction) | |
getAlerts | Active incidents and alerts | |
getMonitors | Monitor configs — filter by table using mcons array | |
getQueriesForTable | Recent query history | |
getQueryData | Full SQL for a specific query | |
createValidationMonitorMac | Generate validation monitors-as-code YAML | |
createMetricMonitorMac | Generate metric monitors-as-code YAML | |
createComparisonMonitorMac | Generate comparison monitors-as-code YAML | |
createCustomSqlMonitorMac | Generate custom SQL monitors-as-code YAML | |
getValidationPredicates | List available validation rule types | |
getAudiences | List notification audiences | |
getDomains | List MC domains | |
getUser | Current user info |
Core workflows
Each workflow has detailed step-by-step instructions in references/workflows.md (Read tool).
1. Asset health pre-fetch (silent delegation to asset-health)
When: User expresses change intent for a table that hasn't been seen in this session. What: Invokes monte-carlo-asset-health via the Skill tool to gather table state (health, upstream lineage, alerts, monitors). Then makes one direct get_asset_lineage(direction="DOWNSTREAM") call to complete the picture (asset-health only fetches upstream). The combined data is used as input to Workflow 2, not shown to the engineer. Two exceptions surface to the user: any disambiguation prompt, and stop-the-world signals (active critical alerts, severe staleness).
2. Change impact assessment — REQUIRED before modifying a model
When: Any intent to modify a dbt model's logic, columns, joins, or filters. What: Surfaces blast radius, downstream dependencies, active incidents, monitor coverage, and query exposure. Reuses asset-health's data when Workflow 1 ran earlier this session; otherwise calls get_asset / get_alerts / get_asset_lineage / get_monitors directly. Produces a risk-tiered report with synthesis connecting findings to specific code recommendations.
3. Change validation queries
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/prevent/SKILL.md
Popularity
- Repository stars
- 89
- Repository forks
- 7
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/monte-carlo-data/mc-agent-toolkit/prevent)