Skip to content

monte-carlo-data/mc-agent-toolkit / skills/prevent

monte-carlo-prevent

Verified

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.

scripts/sandbox/tests/test_classify_sandbox.py

View on GitHub
"""Tests for classify_sandbox.py."""
import json
import subprocess
import sys
from pathlib import Path

import pytest

SCRIPT = Path(__file__).resolve().parents[1] / "classify_sandbox.py"


def _run(name: str) -> dict:
    result = subprocess.run(
        [sys.executable, str(SCRIPT), name],
        capture_output=True,
        text=True,
        check=True,
    )
    return json.loads(result.stdout)


@pytest.mark.parametrize("name,expected", [
    ("PERSONAL_ACHEN", "personal"),
    ("personal_alice", "personal"),
    ("DEV_PLATFORM", "dev"),
    ("SANDBOX_42", "dev"),
    ("MY_DEV", "dev"),
    ("DBT_ACHEN", "shared-dev"),
    ("ANALYTICS", "prod"),
    ("RAW", "prod"),
    ("INGEST", "prod"),
    ("MONTECARLODATA_SHARED", "prod"),
    ("FOO_BAR", "unknown"),
    ("", "unknown"),
])
def test_classify(name, expected):
    assert _run(name) == {"database": name, "classification": expected}


def test_classify_importable():
    """Function form works for direct calls from other scripts."""
    from classify_sandbox import classify
    assert classify("PERSONAL_ACHEN") == "personal"
    assert classify("ANALYTICS") == "prod"
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall