agentleFS
sohaibdevvsohaibdevv/AI-AGENT-SKILLS/skills/ai-ml-engineering/SKILL.md

ai-ml-engineering

Skill2 starsChanged 6 months agoMITView on GitHub

Build ML systems with disciplined training, evaluation, deployment, and safety practices

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 18 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before training or fine-tuning a model

    line 14
  2. Distinctive:

    Before deploying a model to production

    line 15
  3. Distinctive:

    When integrating a third-party LLM API

    line 16
  4. Distinctive:

    When evaluating model quality

    line 17
  5. Distinctive:

    When debugging unexpected model behavior

    line 18
  6. Distinctive:

    Before any code: what is the exact prediction task?

    line 23
  7. Distinctive:

    Check for data leakage (test set information in training set)

    line 29
  8. Distinctive:

    Check for label quality (sample 100 examples manually)

    line 30
  9. Distinctive:

    Check for demographic skew (does the dataset represent production distribution?)

    line 31
  10. Distinctive:

    Check for PII that should not be in training data

    line 32
  11. Distinctive:

    Document the data provenance and version

    line 33
  12. Distinctive:

    Write your evaluation pipeline before training.

    line 43
  13. Distinctive:

    Test for prompt injection

    line 57
  14. Distinctive:

    Test for jailbreak attempts

    line 58
  15. Distinctive:

    Test for harmful output generation

    line 59
  16. Distinctive:

    Test for PII leakage in outputs

    line 60
  17. Distinctive:

    Test for hallucination in factual claims

    line 61
  18. Distinctive:

    No monitoring for distribution shift

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

ML engineering failures are silent and delayed. A model that scores well on the benchmark can fail badly in production. This skill enforces the practices that catch these failures before they reach users: proper evaluation harnesses, data leakage detection, distribution shift monitoring, and safety checks.

When to Use

  • Before training or fine-tuning a model
  • Before deploying a model to production
  • When integrating a third-party LLM API
  • When evaluating model quality
  • When debugging unexpected model behavior

Process

Step 1: Define the task and success metric precisely

Before any code: what is the exact prediction task? What metric proves the model is good enough? What metric proves it is safe enough? Document these as your evaluation contract.

Step 2: Establish the baseline

Compute a simple baseline (majority class, rule-based system, GPT-4 zero-shot). Your model must beat this baseline by a meaningful margin to justify the complexity.

Step 3: Audit the training data

  • Check for data leakage (test set information in training set)
  • Check for label quality (sample 100 examples manually)
  • Check for demographic skew (does the dataset represent production distribution?)
  • Check for PII that should not be in training data
  • Document the data provenance and version

Step 4: Implement a reproducible training pipeline

  • Pin all dependency versions
  • Set all random seeds
  • Version the dataset (not just the model)
  • Store training hyperparameters with model artifacts
  • Confirm: can you reproduce this exact model from scratch?

Step 5: Build the evaluation harness before training

Write your evaluation pipeline before training. Evaluations should be:

  • Automatic (run in CI)
  • Deterministic (same inputs → same scores)
  • Multi-dimensional (accuracy, latency, cost, safety, fairness)
  • Comprehensive (held-out test set + edge case suite)

Step 6: Train with monitoring

Track: training loss, validation loss, gradient norms. Flag: loss spikes, NaN gradients, overfitting (train loss << val loss), underfitting.

Step 7: Run the full evaluation suite

Compare against: baseline, previous model version, human performance (if applicable). Document every dimension. Declare the threshold required for deployment.

Step 8: Safety evaluation

For LLM applications:

  • Test for prompt injection
  • Test for jailbreak attempts
  • Test for harmful output generation
  • Test for PII leakage in outputs
  • Test for hallucination in factual claims

Step 9: Production readiness

  • Latency profiled at p50, p95, p99
  • Cost per inference calculated
  • Graceful degradation defined (what happens when the model is unavailable?)
  • Output validation implemented (reject malformed outputs)
  • Monitoring in place for distribution shift
  • Feedback loop defined for collecting production labels

Step 10: Staged rollout

Deploy to 1% of traffic. Monitor key metrics for 24 hours. Roll out to 10%, then 100%. Have a rollback procedure.

Anti-Rationalizations

"The eval numbers look good" Eval numbers on a curated test set are necessary but not sufficient. Production distribution ≠ test distribution.

"We'll add safety checks after launch" Safety issues discovered after launch are incidents. Safety checks added before launch are requirements.

"The model improved so we should ship it" Improved on which metric? Under which conditions? Improvements in accuracy can come with regressions in latency, fairness, or safety.

Red Flags

  • No baseline comparison
  • Evaluation dataset overlaps with training data
  • Evaluation written after training (to justify the result)
  • No monitoring for distribution shift
  • Model deployed without latency profiling
  • No rollback procedure

Verification Requirements

  • Task and success metric defined before training
  • Baseline computed and documented
  • Training data audited for leakage and PII
  • Training is reproducible from version-pinned code + versioned dataset
  • Evaluation harness built before training
  • Safety evaluation completed
  • Latency profiled at p95
  • Staged rollout plan documented
  • Distribution shift monitoring in place

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.