← Back to Skills Marketplace
mark-stadtmueller

Superwise Drift Detection Skill

by Mark-Stadtmueller · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
43
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install superwise-drift-detection-skill
Description
Detects feature drift in tabular ML models using Superwise Compare Distribution policies (Jensen-Shannon divergence for categorical columns). Handles everyth...
README (SKILL.md)

Superwise Drift Detection Skill

When the user wants to set up drift detection for their model, guide them through the steps below in order. Complete each step before moving to the next.

What You Need From the User

Ask the user to provide the following before starting:

  1. Superwise credentialsSUPERWISE_CLIENT_ID and SUPERWISE_SECRET_TOKEN (found in their Superwise account under Settings → API Keys)
  2. Training CSV — the CSV file their model was trained on (feature columns only; a row_id column will be added automatically)
  3. Model name — a short label with no spaces (e.g. my_churn_model); used to name datasets in Superwise
  4. Inference endpoint — one of two options:
    • Option A: They already have a running model endpoint. Ask for the URL. It must return JSON shaped as {"records": [{...}, ...]} where each record contains the same columns as the training CSV.
    • Option B: They need to deploy one. Use the dc-bikeshare example in examples/dc-bikeshare-drift/app.py as a template. Guide them to adapt predict.py for their model, then run python app.py locally. Set INFERENCE_ENDPOINT_URL=http://localhost:5001/predict for local testing.

Step 1 — Install dependencies

pip install -r requirements.txt

Create a .env file in the skill root directory with the following contents, filling in the values the user provided:

SUPERWISE_CLIENT_ID=\x3Cfrom user>
SUPERWISE_SECRET_TOKEN=\x3Cfrom user>
MODEL_NAME=\x3Cmodel name>
INFERENCE_ENDPOINT_URL=\x3Cfrom user's answer to question 4>
SUPERWISE_AUTO_TRIGGER=true
SUPERWISE_TRAINING_DATASET_ID=
SUPERWISE_TRAINING_DATASET_NAME=
SUPERWISE_TRAINING_CUBE_NAME=
SUPERWISE_INFERENCE_DATASET_ID=
SUPERWISE_INFERENCE_DATASET_NAME=
SUPERWISE_INFERENCE_CUBE_NAME=
SUPERWISE_DRIFT_POLICY_ID=
SCHEDULE_HOUR_UTC=6
SCHEDULE_MINUTE_UTC=0
PORT=5000

The dataset and policy ID fields will be filled in after Steps 2 and 3.

Step 2 — Create Superwise datasets and upload training data

python setup_dataset.py \
    --training-csv path/to/training.csv \
    --model-name their_model_name

This creates a training dataset and an inference dataset in Superwise, uploads the training CSV row by row, and prints the dataset IDs and cube names.

Copy the printed values into .env:

SUPERWISE_TRAINING_DATASET_ID=\x3Cprinted value>
SUPERWISE_TRAINING_DATASET_NAME=\x3Cprinted value>
SUPERWISE_TRAINING_CUBE_NAME=\x3Cprinted value>
SUPERWISE_INFERENCE_DATASET_ID=\x3Cprinted value>
SUPERWISE_INFERENCE_DATASET_NAME=\x3Cprinted value>
SUPERWISE_INFERENCE_CUBE_NAME=\x3Cprinted value>

Note: training CSV column names must use only letters, numbers, and underscores, and must start with a letter. Warn the user if any column names violate this.

Step 3 — Create drift policies

python setup_drift_policy.py \
    --training-csv path/to/training.csv \
    --policy-name their_model_drift

This creates one Jensen-Shannon divergence policy per categorical (string/boolean) column in the training CSV, comparing the training dataset against the inference dataset. Numeric columns are skipped with a warning — this is a known Superwise platform limitation (wasserstein distance for numeric columns is not yet supported).

Copy the primary printed policy ID into .env:

SUPERWISE_DRIFT_POLICY_ID=\x3Cprinted value>

If the user wants to monitor only specific columns, add --columns col1 col2 col3.

Step 4 — Run an end-to-end drift check

python -c "
import os; os.chdir('.')
from dotenv import load_dotenv; load_dotenv()
from skill import run
result = run()
print(result)
"

This will:

  1. Fetch inference records from INFERENCE_ENDPOINT_URL
  2. Ingest them into the Superwise inference dataset
  3. Trigger the drift policy evaluation
  4. Poll until the evaluation completes
  5. Send an alert via OpenClaw's Telegram connection if drift is detected
  6. Print a summary

Step 5 — Schedule recurring drift checks

Register the skill with OpenClaw using the metadata in skill.py:

  • Trigger command: /drift_check
  • Schedule: 0 6 * * * (06:00 UTC daily — adjust to the user's inference cadence)
  • Alerts: routed through OpenClaw's existing Telegram connection

For a production deployment, guide the user to deploy scheduler.py to Render using the included render.yaml. Set all .env values as Render environment variables.

Telegram Alerts

This skill uses OpenClaw's existing Telegram connection — no separate bot setup needed. The _send_telegram() function in skill.py uses TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID from the user's OpenClaw environment. If the user does not have Telegram set up in OpenClaw yet, point them to OpenClaw's Telegram setup docs.

Drift alerts look like:

  • Unhealthy: lists features with high drift (score > 0.2), flags that predictions may be unreliable
  • Healthy: confirms no significant drift with per-feature scores

Reference Example: DC Bikeshare

examples/dc-bikeshare-drift/ is a complete working example the user can run to verify the skill end-to-end before connecting their own model:

cd examples/dc-bikeshare-drift
pip install -r requirements.txt
python collect_training_data.py   # fetch real station data, generate synthetic history
python train.py                   # train RandomForest classifier
python app.py                     # start local Flask inference server on port 5001

Then run the drift check from the skill root with:

INFERENCE_ENDPOINT_URL=http://localhost:5001/predict

This example uses only categorical features (station size, e-bike presence, hour of day, day type, season) to predict bike availability — all suitable for JSD drift detection.

Retraining

When the user retrains their model:

python setup_dataset.py \
    --training-csv path/to/new_training.csv \
    --model-name their_model_name \
    --retrain

This creates a versioned replacement training dataset and preserves the inference history. Update .env with the new training dataset ID and cube name, then re-run setup_drift_policy.py to create a new policy pointing at the updated baseline.

Troubleshooting

  • Policy stays pending forever: Check that inference records were successfully ingested before triggering. The inference dataset must have data for the policy to evaluate.
  • unhealthy on first run: Expected if inference records are a single time-slice snapshot (all same hour/day/season). Accumulate inference records over time for a more representative distribution.
  • Numeric columns skipped: Wasserstein distance for numeric dimensions is a known Superwise platform bug. Use categorical bucketing as a workaround, or wait for the Superwise platform fix.
  • CubeJS cube not found after upload: New datasets take a few minutes to register in Superwise's CubeJS layer. Wait 2–3 minutes and retry verification.
Usage Guidance
This skill appears suitable for its stated purpose if you are comfortable giving it Superwise API access and sending selected model feature data to Superwise. Before installing, pin dependencies, use a limited-scope API key if possible, avoid sensitive columns in the CSV/inference records, review any generated debug files, and confirm the daily schedule/Render deployment is what you want.
Capability Analysis
Type: OpenClaw Skill Name: superwise-drift-detection-skill Version: 1.0.1 The skill bundle provides a legitimate integration for monitoring machine learning model drift using the Superwise platform. It includes comprehensive scripts for dataset setup (setup_dataset.py), drift policy configuration (setup_drift_policy.py), and a recurring scheduler (scheduler.py) that fetches inference data and triggers evaluations. The core logic in skill.py and superwise_ingest.py handles API interactions with Superwise and sends alerts via Telegram as described. While the skill requires sensitive credentials (API tokens), their use is strictly aligned with the stated purpose, and no evidence of malicious intent, unauthorized data exfiltration, or harmful prompt injection was found across the code or documentation.
Capability Assessment
Purpose & Capability
The requested capabilities match the stated purpose: creating Superwise datasets and drift policies, ingesting training/inference records, triggering evaluations, and alerting via Telegram. These are sensitive integrations but are disclosed and purpose-aligned.
Instruction Scope
The setup is user-directed and asks for specific files, credentials, endpoint URL, and model name. It also defaults to automatic policy triggering and daily scheduled checks, which are disclosed but should be confirmed by the user.
Install Mechanism
There is no registry install spec, but SKILL.md instructs users to run pip install and Python setup scripts. Dependencies are unpinned, so users should review the environment before installing.
Credentials
The skill uses Superwise credentials, an inference endpoint, and Telegram environment variables. This is proportionate for drift monitoring, but the registry metadata does not declare these required environment variables.
Persistence & Privilege
The skill supports a recurring scheduled deployment via Render and OpenClaw. This is expected for monitoring, but users should ensure the schedule and any exposed run endpoint are appropriate for their account.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install superwise-drift-detection-skill
  3. After installation, invoke the skill by name or use /superwise-drift-detection-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Updated Step 1 instructions to require manual creation of a `.env` file instead of copying from `.env.example`. - Added explicit list of required `.env` variables, including scheduling and port settings. - Clarified that dataset and policy ID fields in `.env` should be filled after Steps 2 and 3. - Removed the instruction to copy `.env.example` and replaced with detailed `.env` content guidance. - No code changes; documentation and setup process improvement only.
v1.0.0
Superwise Drift Detection Skill v1.0.0 - Initial release supporting end-to-end drift detection for tabular ML models using Superwise Compare Distribution policies. - Handles Superwise dataset creation, training data upload, drift policy setup, inference data ingestion, and Telegram alerts (via OpenClaw integration). - Setup scripts are idempotent — safe to re-run; existing datasets and policies are detected and skipped automatically. - Guides user through setup: credential entry, selecting/deploying inference endpoint, configuring environment, and recurring scheduling. - Supports categorical features for drift detection (Jensen-Shannon divergence); numeric features are skipped with a warning. - Includes reference DC Bikeshare example for easy verification. - Provides clear troubleshooting and retraining instructions.
Metadata
Slug superwise-drift-detection-skill
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Superwise Drift Detection Skill?

Detects feature drift in tabular ML models using Superwise Compare Distribution policies (Jensen-Shannon divergence for categorical columns). Handles everyth... It is an AI Agent Skill for Claude Code / OpenClaw, with 43 downloads so far.

How do I install Superwise Drift Detection Skill?

Run "/install superwise-drift-detection-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Superwise Drift Detection Skill free?

Yes, Superwise Drift Detection Skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Superwise Drift Detection Skill support?

Superwise Drift Detection Skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Superwise Drift Detection Skill?

It is built and maintained by Mark-Stadtmueller (@mark-stadtmueller); the current version is v1.0.1.

💬 Comments