agentleFS
ucdavisucdavis/ai-skills-registry/skills/data-science-python/SKILL.md

data-science-python

Skill9 starsChanged 8 months agoMITView on GitHub

Python data science: notebook structure, data validation, reproducibility, and model documentation

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep notebooks for exploration.

    line 18
  2. Distinctive:

    Document for every model:

    line 51
  3. Very specific:

    Write unit tests for data processing functions in tests/.

    line 70
  4. Very specific:

    Use pathlib.Path — never hardcode file paths.

    line 71
  5. Very specific:

    Use logging not print in production code.

    line 72

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

Data Science — Python

Notebook Structure

Organize notebooks in this order:

  1. Imports & configuration
  2. Data loading
  3. Exploratory data analysis (EDA)
  4. Feature engineering
  5. Modeling
  6. Evaluation
  7. Conclusions & next steps

Keep notebooks for exploration. Move reusable logic to src/ Python modules with tests.

Data Validation

# Always validate after loading
assert df.shape[0] > 0, "DataFrame is empty"
assert df.isnull().sum().sum() == 0, f"Nulls found: {df.isnull().sum()}"
assert df['price'].between(0, 1_000_000).all(), "Price out of expected range"

# For production pipelines: use pandera
import pandera as pa
schema = pa.DataFrameSchema({
    "price": pa.Column(float, pa.Check.ge(0)),
    "category": pa.Column(str, pa.Check.isin(["A", "B", "C"])),
})
schema.validate(df)

Reproducibility

import random
import numpy as np

SEED = 42
random.seed(SEED)
np.random.seed(SEED)
# sklearn: pass random_state=SEED to all estimators
  • Pin all dependency versions in requirements.txt or pyproject.toml.
  • Track experiments: MLflow, or a simple experiments/ log with metadata JSON.
  • Save models with timestamp + metadata: model_rf_20260115_v1.pkl.

Model Documentation

Document for every model:

  • Training data: source, date range, size, preprocessing steps.
  • Feature list and engineering decisions.
  • Hyperparameters and tuning approach.
  • Evaluation metrics on held-out test set.
  • Known limitations and failure modes.

Code Quality

# Extract transforms into sklearn Pipeline
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier

pipeline = Pipeline([
    ('scaler', StandardScaler()),
    ('classifier', RandomForestClassifier(random_state=SEED)),
])
  • Write unit tests for data processing functions in tests/.
  • Use pathlib.Path — never hardcode file paths.
  • Use logging not print in production code.

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.