agentleFS
MacroTechTitanMacroTechTitan/MaximusAI/skills/maximus-ai-data-pipeline/SKILL.md

maximus-ai-data-pipeline

Skill1 starsChanged 4 months agoMITView on GitHub

Training-data pipelines for ML: curation, labeling guidelines, synthetic data, quality gates, DVC/LakeFS versioning, split isolation, leakage prevention, dataset cards, deletion compliance. Use for 'build a training dataset', 'labeling', 'synthetic data', 'train test split', 'dataset card'.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 13 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not use this skill for generic data engineering (ETL pipelines that don't feed model training).

    line 20
  2. Distinctive:

    Train/val/test are sacred splits: No model developer touches the test set until final evaluation.

    line 25
  3. Distinctive:

    Deletion is a day-one concern: If user data goes into training, plan the deletion workflow before you train, not after the legal letter …

    line 28
  4. Very specific:

    Use DVC (dvc init, dvc add data/, remote configured to S3 or GCS) for file-level versioning tied to git commits.

    line 39
  5. Distinctive:

    Use LakeFS if you need branch-and-merge semantics on a data lake (parquet/delta tables at scale).

    line 40
  6. Distinctive:

    Write explicit labeling guidelines: definition of each label, positive examples, negative examples, hard cases.

    line 45
  7. Distinctive:

    Run a pilot: 3–5 annotators label the gold set independently.

    line 47
  8. Distinctive:

    Use Label Studio (open source), Scale AI, Labelbox, or Argilla depending on volume and budget.

    line 51
  9. Distinctive:

    Use LLM-generated synthetic data to: augment rare classes, cover edge cases, generate adversarial inputs.

    line 57
  10. Distinctive:

    Document the generation method, model, prompt, and filter in the dataset card.

    line 59
  11. Distinctive:

    Never use validation or test data to tune hyperparameters.

    line 72
  12. Distinctive:

    Use the Hugging Face dataset card schema or Gebru et al.

    line 76
  13. Distinctive:

    If exact removal from trained model weights is required, assess machine unlearning options or plan to retrain from the next clean snapshot.

    line 83
  14. Distinctive:

    Document the deletion SLA in the dataset card.

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Maximus — AI Data Pipeline

The model is only as good as the data it was trained on, and the data is only as good as the discipline behind it. This skill covers AI-specific data work: curation strategy, labeling rigor, synthetic generation, quality gates, versioning, and the legal obligations that trail every labeled example.

When to use

  • Building a new training, fine-tuning, or evaluation dataset.
  • Auditing an existing dataset for quality, leakage, or compliance gaps.
  • Setting up reproducible data versioning for a model training workflow.
  • Responding to a deletion (right-to-be-forgotten) request on data used in training.

Do not use this skill for generic data engineering (ETL pipelines that don't feed model training). For those, a standard data engineering workflow applies.

Core rules

  1. Dataset card before labeling. Define the dataset's intended use, source, annotation schema, and known limitations before a single annotation is made. Cards drafted after the fact omit the decisions that matter most.
  2. Train/val/test are sacred splits. No model developer touches the test set until final evaluation. Ever. Leakage is the silent killer of believable benchmarks.
  3. Label quality beats label quantity. Ten thousand noisy examples hurt more than one thousand clean ones. Define a quality bar and enforce it with inter-rater agreement before scaling.
  4. Version everything. Data + code + model = one reproducible artifact. Use DVC or LakeFS. "We trained on the latest CSV" is not a reproducible experiment.
  5. Deletion is a day-one concern. If user data goes into training, plan the deletion workflow before you train, not after the legal letter arrives.

Procedure

  1. Define the curation strategy.
    • What is the task? (classification, generation, ranking, extraction)
    • What is the data source? (user logs, web crawl, curated manual, synthetic, purchased third-party)
    • What are the in-scope and out-of-scope examples? Write a 1-page curation spec.
    • Set a volume target: how many examples per class/task for the statistical power you need? Use a power analysis or a heuristic (fine-tuning typically needs 100–10,000 labeled examples; evaluation sets need ≥ 200 per slice).
  2. Set up data versioning.
    • Use DVC (dvc init, dvc add data/, remote configured to S3 or GCS) for file-level versioning tied to git commits.
    • Use LakeFS if you need branch-and-merge semantics on a data lake (parquet/delta tables at scale).
    • Tag every dataset version: v1.0.0-raw, v1.1.0-filtered, v2.0.0-augmented. Never overwrite a prior version.
    • Store the DVC pointer file (.dvc) in git so any commit can reproduce its exact dataset.
  3. Design the labeling schema and guidelines.
    • Write explicit labeling guidelines: definition of each label, positive examples, negative examples, hard cases.
    • Define a gold set (50–200 pre-labeled examples with known-correct labels) for annotator calibration.
    • Run a pilot: 3–5 annotators label the gold set independently. Measure inter-rater agreement (Cohen's κ for categorical; Krippendorff's α for multi-label or ordinal). Target κ ≥ 0.7 before scaling.
    • See references/labeling-disciplines.md for agreement metrics and thresholds.
  4. Execute labeling at scale.
    • Use Label Studio (open source), Scale AI, Labelbox, or Argilla depending on volume and budget.
    • Seed every batch with gold-set examples (10% of each annotator's queue) to detect annotator drift.
    • Flag and adjudicate disagreements (majority vote, expert review, or consensus session).
    • Track per-annotator agreement continuously. Remove annotators below threshold.
  5. Generate synthetic data (when needed).
    • Use LLM-generated synthetic data to: augment rare classes, cover edge cases, generate adversarial inputs.
    • Apply a quality gate: every synthetic example is reviewed by at least one human annotator, or filtered by an automated classifier with a known precision threshold.
    • Document the generation method, model, prompt, and filter in the dataset card. Do not mix synthetic and human-labeled examples silently — flag provenance per row.
    • Contamination risk: if the LLM was trained on data similar to your evaluation domain, synthetic examples may leak benchmark answers. Use held-out prompts or out-of-distribution generation.
  6. Apply quality gates.
    • Deduplication: remove near-duplicates (MinHash LSH or embedding similarity). Duplicates between train and eval inflate benchmark scores.
    • Toxicity filter: run the dataset through a content classifier; remove or quarantine flagged examples.
    • PII scan: use Presidio or equivalent to detect and remove personal information. Coordinate with maximus-ai-safety-governance.
    • Distribution check: plot label distribution, input length distribution, and (for NLP) vocabulary coverage. Flag unexpected skews.
  7. Enforce train/val/test isolation.
    • Split before any feature engineering or augmentation (split on raw examples, not derived features).
    • For time-series or temporal data: split by time, not randomly.
    • For user-level data: split by user, not by interaction (to prevent user-level leakage).
    • Never use validation or test data to tune hyperparameters.
    • See examples/leakage-check.py for automated leakage detection.
  8. Write the dataset card.
    • Use the Hugging Face dataset card schema or Gebru et al. (2021) "Datasheets for Datasets" as the template.
    • Required sections: Dataset description, Source data, Annotation process, Quality metrics (agreement scores, pass rates), Known limitations, Licensing, Maintenance.
    • Publish the card with the versioned dataset. Update it on every major version bump.
  9. Implement deletion/right-to-be-forgotten compliance.
    • Maintain a mapping from user ID → data row IDs in the dataset.
    • On deletion request: remove rows from all dataset versions and from any downstream fine-tuned model checkpoints (this may require retraining from a clean snapshot).
    • If exact removal from trained model weights is required, assess machine unlearning options or plan to retrain from the next clean snapshot.
    • Document the deletion SLA in the dataset card.

Domain notes

  • DVC (Data Version Control, MIT license) is the standard for file-based ML dataset versioning. Works alongside git. dvc repro reruns the full pipeline from source.
  • LakeFS (open source / cloud) adds git-like branching to S3/GCS object stores — useful for teams running large-scale experiments on parquet tables.
  • Argilla is the best open-source tool for LLM data annotation and RLHF preference collection.
  • Cohen's κ is the standard for categorical tasks; Krippendorff's α handles ordinal, interval, and multi-annotator cases.
  • GDPR Article 17 (right to erasure) and CCPA Section 1798.105 require deletion of personal data on request. There is active legal debate about whether this requires model retraining; assume yes for high-risk systems.
  • Machine unlearning is an active research area. For production, plan for retraining from a clean data snapshot as the pragmatic fallback.

Gotchas

  • Deduplication that runs on train + val + test together will remove cross-split duplicates you needed to find. Dedup train separately, then check for overlap against val/test.
  • "We'll label more later" without a quality process produces a growing pile of inconsistent examples. Fix the guidelines first.
  • Synthetic data that works in the lab often fails in production because the LLM generates cleaner, more idealized examples than real user inputs. Weight synthetic data accordingly.
  • DVC remote credentials in the git repo is a credential leak. Use environment variables or a secret manager.
  • Dataset versioning is only useful if you also track which dataset version trained which model. Use experiment tracking (MLflow, W&B) to link them.

Output

Versioned dataset (DVC-tracked), dataset card, labeling guidelines document, quality gate report (dedup count, toxicity filter count, PII scan results, label distribution, inter-rater agreement score), train/val/test split manifest, deletion compliance plan.

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.