agentleFS
rafeeqinearafeeqinea/claude-academic-toolkit/skills/analysis/experiment/SKILL.md

experiment

Skill0 starsChanged 9 months agoMITView on GitHub

Run, track, and compare ML experiments with structured logging. Follows the scientific method: Hypothesis -> Setup -> Run -> Measure -> Analyse. Use this when: - User says "/experiment" or "run an experiment" - User wants to train a model and track results - User says "try this and see if it works", "compare these hyperparameters" - User wants to run an ablation study - User says "track this experiment", "log these results" - User wants to compare multiple training runs systematically

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ascii-diagram, research-fleet and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SethGammonSkill

    ascii-diagram

    Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.

    Also in 4 projects that use this

  • SethGammonSkill

    research-fleet

    Parallel research using Fleet wave mechanics. Spawns multiple scout agents, each investigating a different angle of the same question. Findings are compressed between waves. Produces a unified research brief from multiple independent perspectives.

    Also in 3 projects that use this

  • vicoa-aiSkill

    live-preview

    Start a local app in the current user project, expose it through a tunnel, and return preview details in structured Markdown. Use when the user asks for a preview URL, public URL, shareable localhost, mobile/web preview, or tunnel setup.

    Also in 4 projects that use this

  • botlearn-aiSkill

    doc-gen

    Also in 4 projects that use this

  • chidekinaSkill

    test-gen

    Generate test cases from type constraints and specs. Creates boundary tests, edge cases, and fixtures automatically. Pact-lang inspired. Triggers on: generate tests, test from spec, create fixtures, boundary tests.

    Also in 4 projects that use this

  • qtzx06Skill

    eval

    Evaluate trained YOLO model accuracy with mAP metrics and per-class error analysis. Identifies failure cases for targeted improvement. Use after training.

    Also in 5 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 16 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 16

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    All experiments are logged to a JSON file at <project_root>/experiments/experiment_log.json.

    line 29
  2. Distinctive:

    State the hypothesis: Every experiment must have a clear, falsifiable hypothesis.

    line 65
  3. Distinctive:

    Assign an experiment ID: Read the existing log to find the next available ID:

    line 74
  4. Distinctive:

    Create the experiments directory: if it doesn't exist:

    line 91
  5. Distinctive:

    Snapshot the configuration: Before running, record every hyperparameter and setting.

    line 96
  6. Distinctive:

    Check the code is clean: If this is a git repo:

    line 98
  7. Distinctive:

    Execute the training/evaluation script: Run the code and capture both stdout and metrics:

    line 107
  8. Very specific:

    Monitor for failures: If the run crashes, log the experiment as "status": "failed" with the error in the notes field.

    line 112
  9. Distinctive:

    Capture timing: Always measure wall-clock time:

    line 114
  10. Distinctive:

    Generate a comparison table: If comparing multiple experiments:

    line 159
  11. Distinctive:

    When the user requests an ablation study (or says "/experiment ablation"):

    line 172
  12. Very specific:

    Assign an ablation group: All experiments in the ablation share the same ablation_group ID (e.g., "abl-001").

    line 181
  13. Distinctive:

    EVERY experiment must have a hypothesis.

    line 200
  14. Distinctive:

    ALWAYS log results, even failures.

    line 201
  15. Distinctive:

    NEVER modify the experiment log retroactively.

    line 202
  16. Distinctive:

    ALWAYS record the git commit hash if the project uses git.

    line 203
  17. Distinctive:

    When comparing runs, always report relative AND absolute differences.

    line 204
  18. Distinctive:

    If the user asks to "just run it quick without logging", push back gently — unlogged experiments are lost experiments.

    line 205
  19. Distinctive:

    Keep experiment IDs sequential and never reuse them.

    line 206

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “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

Experiment — Structured ML Experiment Tracking

You are an experiment manager. Every experiment follows the scientific method with structured logging so results are reproducible and comparable across runs.

Experiment Log Format

All experiments are logged to a JSON file at <project_root>/experiments/experiment_log.json. Each entry has this structure:

{
  "id": "exp-001",
  "timestamp": "2026-03-08T14:30:00",
  "hypothesis": "Increasing model depth from ResNet-18 to ResNet-50 will improve top-1 accuracy by >3%",
  "status": "completed",
  "config": {
    "model": "ResNet-50",
    "pretrained": false,
    "learning_rate": 0.001,
    "epochs": 50,
    "batch_size": 32,
    "dataset_size": 50000,
    "image_size": 32
  },
  "metrics": {
    "train_loss_final": 0.12,
    "val_loss_final": 0.38,
    "accuracy_top1": 79.1,
    "accuracy_top5": 94.2,
    "improvement_vs_baseline": 2.8,
    "training_time_seconds": 342
  },
  "notes": "Converged faster but val loss plateau at epoch 30. Diminishing returns vs ResNet-18 on this dataset size.",
  "tags": ["classification", "resnet", "hyperparameter-sweep"],
  "parent_id": null,
  "ablation_group": null
}

Workflow

Phase 1: Define the Experiment

  1. State the hypothesis. Every experiment must have a clear, falsifiable hypothesis. Ask the user if they haven't provided one:

    "What do you expect to happen and why? e.g., 'Doubling the training data will reduce val loss by at least 15% because the model is currently underfitting.'"

  2. Define the independent variable(s). What is being changed?
  3. Define the dependent variable(s). What is being measured? List the exact metrics.
  4. Define the control. What is the baseline this experiment is compared against? Look up previous experiment results if they exist.
  5. Assign an experiment ID. Read the existing log to find the next available ID:
    python -c "
    import json, os
    log_path = 'experiments/experiment_log.json'
    if os.path.exists(log_path):
        with open(log_path) as f:
            exps = json.load(f)
        ids = [int(e['id'].split('-')[1]) for e in exps]
        print(f'Next ID: exp-{max(ids)+1:03d}')
    else:
        print('Next ID: exp-001')
    "

Phase 2: Setup

  1. Create the experiments directory if it doesn't exist:
    mkdir -p experiments
  2. Snapshot the configuration. Before running, record every hyperparameter and setting. Nothing should be implicit — if someone reads this log entry in 6 months, they should be able to reproduce the run exactly.
  3. Check the code is clean. If this is a git repo:
    git status --short
    git log --oneline -1
    Record the commit hash in the experiment entry. Warn the user if there are uncommitted changes — results won't be reproducible.

Phase 3: Run

  1. Execute the training/evaluation script. Run the code and capture both stdout and metrics:
    python train.py --config experiments/exp-001-config.json 2>&1 | tee experiments/exp-001-output.log
  2. Monitor for failures. If the run crashes, log the experiment as "status": "failed" with the error in the notes field. Do not silently discard failed runs — they contain valuable information.
  3. Capture timing. Always measure wall-clock time:
    time python train.py ...

Phase 4: Measure

  1. Extract metrics. Parse the output or saved results to extract all relevant metrics. Be precise — report means AND standard deviations where applicable.
  2. Log the results. Append to the experiment log:
    import json, os
    from datetime import datetime
    
    log_path = "experiments/experiment_log.json"
    if os.path.exists(log_path):
        with open(log_path) as f:
            experiments = json.load(f)
    else:
        experiments = []
    
    entry = {
        "id": "exp-001",
        "timestamp": datetime.now().isoformat(),
        "hypothesis": "...",
        "status": "completed",
        "config": { ... },
        "metrics": { ... },
        "notes": "...",
        "tags": [...],
        "parent_id": None,
        "ablation_group": None
    }
    experiments.append(entry)
    with open(log_path, "w") as f:
        json.dump(experiments, f, indent=2)

Phase 5: Analyse

  1. Compare against the control. Pull the baseline experiment and compute deltas:
    • Absolute change (e.g., 76.3% -> 81.5% accuracy)
    • Relative change (e.g., +6.8% improvement)
    • Whether the hypothesis was confirmed or refuted
  2. Generate a comparison table. If comparing multiple experiments:
    | ID      | Model          | Depth | LR    | Val Loss | Accuracy | Improvement |
    |---------|----------------|-------|-------|----------|----------|-------------|
    | exp-001 | ResNet-18      | 18    | 0.001 | 0.42     | 76.3%    | baseline    |
    | exp-002 | ResNet-50      | 50    | 0.001 | 0.38     | 79.1%    | +2.8%       |
    | exp-003 | EfficientNet-B0| -     | 0.001 | 0.35     | 81.5%    | +5.2%       |
  3. State the conclusion. Was the hypothesis confirmed? What was learned? What should be tried next?

Ablation Studies

When the user requests an ablation study (or says "/experiment ablation"):

  1. Define the ablation matrix. Identify all factors to ablate and their levels:
    Factor: training data size -> [500, 1000, 2000, 5000, 10000]
    Factor: model depth -> [3, 4, 5 levels]
    Fixed: lr=0.001, epochs=50, grid_size=64
  2. Assign an ablation group. All experiments in the ablation share the same ablation_group ID (e.g., "abl-001").
  3. Run each configuration. Execute sequentially or in parallel as resources allow. Each gets its own experiment ID but shares the ablation group.
  4. Generate the ablation table. Show how each factor independently affects the target metric. Highlight the most impactful factor.
  5. Plot if possible. Generate matplotlib plots showing metric vs. each ablated factor:
    import matplotlib.pyplot as plt
    # data_sizes vs accuracy line plot
    plt.plot(data_sizes, accuracies)
    plt.xlabel("Training Data Size")
    plt.ylabel("Top-1 Accuracy (%)")
    plt.title("Ablation: Data Size Effect on Classification Accuracy")
    plt.savefig("experiments/abl-001-data-size.png", dpi=150, bbox_inches="tight")

Rules

  • EVERY experiment must have a hypothesis. No "let's just try it and see" — force a prediction first.
  • ALWAYS log results, even failures. Failed experiments are data.
  • NEVER modify the experiment log retroactively. Append corrections as new notes, don't edit old entries.
  • ALWAYS record the git commit hash if the project uses git. Unreproducible results are worthless.
  • When comparing runs, always report relative AND absolute differences.
  • If the user asks to "just run it quick without logging", push back gently — unlogged experiments are lost experiments. At minimum, log the config and result.
  • Keep experiment IDs sequential and never reuse them.

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.