ML-MLOps-Portfolio: Skill for Claude Code

.devin/skills/drift-detection/SKILL.md

drift-detection is a skill for Claude Code from DuqueOM/ML-MLOps-Portfolio. It costs 27 tokens per session (2,240 once invoked), scanned A, original, MIT.

A procedure for checking whether an ML service’s input data or prediction quality has changed over time. ML means software that learns patterns from data; PSI compares data distributions, while sliced metrics compare performance for groups or segments.

In plain words
What is it for?
Use it to check feature distributions without labels, compare AUC or F1 against a baseline when delayed labels are available, and decide whether to monitor or retrain.
Why use it?
It helps distinguish normal changes in incoming data from changes that make the model less accurate.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is DuqueOM/ML-MLOps-Portfolio's own configuration. It tells Claude Code how to work on ML-MLOps-Portfolio itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ML-MLOps-Portfolio configures →

Reuse

Borrowing it

Nothing to install: this file belongs to DuqueOM/ML-MLOps-Portfolio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/DuqueOM/ML-MLOps-Portfolio/main/.devin/skills/drift-detection/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/DuqueOM/ML-MLOps-Portfolio

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drift-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/duqueom/ml-mlops-portfolio/drift-detection.svg)](https://agentmods.dev/skills/duqueom/ml-mlops-portfolio/drift-detection)
Your own site
<a href="https://agentmods.dev/skills/duqueom/ml-mlops-portfolio/drift-detection"><img src="https://agentmods.dev/badge/skills/duqueom/ml-mlops-portfolio/drift-detection.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,240 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.02240
Opus 5 $0.00014 $0.01120
Sonnet 5 $0.00005 $0.00448
Haiku 4.5 $0.00003 $0.00224

Measured 7d ago against content hash fa5971133ba1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

drift-detection scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Bash(curl:*)
.devin/skills/drift-detection/SKILL.md · 232 lines

How it starts

The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Drift Detection

Two complementary layers (ADR-006):

  • Data drift (PSI on feature distributions) — early signal, no labels needed
  • Concept drift (sliced AUC/F1 vs baseline, using delayed labels) — ground truth

Always investigate data drift FIRST (cheaper, faster). Escalate to concept drift analysis when (a) PSI alert fires and you need to confirm impact, or (b) a performance alert fires directly (AUC below threshold).

Step 1: Understand the Drift Metric

PSI Interpretation Guide

PSI Value Status Action Exit Code
< 0.10 Stable No action 0
0.10 – 0.20 Warning Monitor, increase check frequency 1
> 0.20 Alert Trigger retraining 2

ALWAYS use quantile-based bins (not uniform):

breakpoints = np.percentile(reference, np.linspace(0, 100, bins + 1))

Uniform bins can produce empty bins at extremes → PSI dominated by epsilon noise.

Special Cases — When PSI Doesn't Apply

Feature Type Problem with PSI Alternative
Time series (seasonal) PSI flags every seasonal change as "drift" Year-over-Year comparison (same period last year)
Text/NLP features PSI not meaningful for text OOV (Out-of-Vocabulary) rate: warning > 20%, alert > 35%
Low-cardinality categorical Quantile bins don't work with 3-5 categories Categorical PSI variant: bins = unique categories
Boolean features Only 2 bins → unstable PSI Simple proportion test (chi-squared)

Exit Codes for CronJob Integration

  • exit 0 → all features stable
  • exit 1 → warning-level drift (monitor)
  • exit 2 → alert-level drift (retraining needed, GitHub Issue created)

Step 2: Run Drift Detection Manually

python src/{service}/monitoring/drift_detection.py \
  --reference data/reference/{service}_reference.csv \
  --current data/production/{service}_latest.csv \
  --output drift_report.json

Read the full file on GitHub · 232 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 232 lines · 27 tokens per session scan A fa5971133ba1

Subscribe to this mod's changes

drift-detection is a skill published in the GitHub repository DuqueOM/ML-MLOps-Portfolio (5 stars, last pushed 6d ago), licensed MIT. It adds 27 tokens to every session and 2,240 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.