ML-MLOps-Portfolio: Skill for Claude Code

.devin/skills/model-retrain/SKILL.md

model-retrain is a skill for Claude Code from DuqueOM/ML-MLOps-Portfolio. It costs 14 tokens per session (1,761 once invoked), scanned A, original, MIT.

A procedure for retraining an ML model and checking its quality before promotion. Promotion means moving a model from training to staging or production.

In plain words
What is it for?
Use it to train and log a model, review metrics and drift results, request approval for staging, and open a pull request before any production change.
Why use it?
It prevents a newly trained model from reaching users when its accuracy, fairness, or other quality checks are unacceptable.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions AGENTS.md.

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/model-retrain/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 model-retrain

README.md
[![agentmods](https://agentmods.dev/badge/skills/duqueom/ml-mlops-portfolio/model-retrain.svg)](https://agentmods.dev/skills/duqueom/ml-mlops-portfolio/model-retrain)
Your own site
<a href="https://agentmods.dev/skills/duqueom/ml-mlops-portfolio/model-retrain"><img src="https://agentmods.dev/badge/skills/duqueom/ml-mlops-portfolio/model-retrain.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,761 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00014 $0.01761
Opus 5 $0.00007 $0.00881
Sonnet 5 $0.00003 $0.00352
Haiku 4.5 $0.00001 $0.00176

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

Security

Grade A, and why

model-retrain scanned grade A with 0 findings 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.devin/skills/model-retrain/SKILL.md · 202 lines

How it starts

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

Model Retraining

Authorization Protocol

This skill spans three authorization layers, aligned with the Agent Behavior Protocol (AGENTS.md):

Phase Mode What happens
Training (MLflow run) AUTO Agent may run training, log to MLflow, produce artifacts
Transition to Staging CONSULT Agent presents metrics + quality gates + drift diff; human approves via MLflow UI or /promote-model PR
Transition to Production STOP Never transitions directly. Opens PR, waits for Tech Lead approval via GitHub Environment production

Automatic STOP escalation

Even in AUTO phase, escalate to STOP if the new model exhibits any of:

  • Primary metric > 0.99 without explanation (D-06 — investigate leakage)
  • Fairness DIR in [0.80, 0.85] (marginal — human judgment required)
  • Metric regression > 5% vs current production
  • Any quality gate fails

Emit structured signal:

[AGENT MODE: STOP]
Operation: Model retraining for {service}
Reason: Fairness DIR = 0.82 (marginal, requires human review)
Waiting for: Engineer inspection + either ADR documenting decision OR retraining with fairness-aware loss

Step 1: Validate Retraining Trigger

Before retraining, confirm the trigger:

  • Drift alert: PSI ≥ threshold on critical feature (check Prometheus/Grafana)
  • Metric degradation: Rolling metric below quality gate (check monitoring)
  • Scheduled: Periodic retraining per policy
  • Manual: Engineer-initiated (document reason)

Step 2: Download Fresh Data

# Download latest production data
gsutil cp gs://{data-bucket}/{service}/production_data_latest.csv data/raw/
# Or from AWS:
aws s3 cp s3://{data-bucket}/{service}/production_data_latest.csv data/raw/

Step 3: Validate Data Before Training

python -c "
from src.{service}.schemas import ServiceInputSchema
import pandas as pd
import pandera as pa

df = pd.read_csv('data/raw/production_data_latest.csv')
ServiceInputSchema.validate(df)
print(f'Validation passed: {len(df)} rows, {len(df.columns)} columns')
"

Read the full file on GitHub · 202 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. 8d ago First seen · 202 lines · 14 tokens per session scan A 2eba210371c8

Subscribe to this mod's changes

model-retrain is a skill published in the GitHub repository DuqueOM/ML-MLOps-Portfolio (5 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 1,761 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.