light-experiment-coding

Implements frozen research plans as tested, leakage-free, reproducible experiment code with hash-verified run artifacts.

572|72|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Light0305/Light-skills --skill light-experiment-coding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: light-experiment-coding
Source: https://github.com/Light0305/Light-skills/tree/main/skills/light-experiment-coding
Command: npx skills add https://github.com/Light0305/Light-skills --skill light-experiment-coding

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, hypothesis, scikit-learn, numpy, pandas, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

It turns a frozen research question, experiment matrix, and pre-registration into minimal runnable experiment code that is test-first, free of train/test data leakage, seeded for reproducibility, and auditable through hash-verified raw run bundles, so downstream result analysis can recompute everything from evidence.

Core Features & Use Cases

  • Test-first experiment implementation: Write gold, property-based (Hypothesis), metamorphic, and train-only-fit tests before implementing preprocessing, training, and evaluation code.
  • Leakage and reproducibility gates: Run review_gate, seed_audit, repro_gate, and run_artifact_check scripts that emit machine-readable findings where data leakage or incomplete seeding is a critical failure.
  • Run manifest and execution contract: Record config, code commit, environment, input SHA256 hashes, stdout/stderr, raw metrics, and per-entity predictions for every run, validated against a frozen execution contract with budget and remote-execution authorization checks.
  • Use Case: Given a pre-registered sklearn or PyTorch experiment matrix, scaffold the project, write failing tests first, control Python/NumPy/CUDA/DataLoader randomness, run the same seed twice to compare prediction hashes, and hand the complete run bundles to result analysis.

Quick Start

Ask the AI to implement the frozen experiment matrix from my research plan as test-first, leakage-free, reproducible training code and run the stage-6 gates on it.

Frequently Asked Questions about light-experiment-coding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent data leakage in sklearn machine learning experiments?

Split data before fitting any preprocessor, then call fit or fit_transform only on the training fold and transform on the test fold. For cross-validation, place preprocessors and the model inside an sklearn Pipeline so each fold is fitted only on its training partition, and use group-aware splits so entities never cross train and test.

How do I make PyTorch training runs reproducible with fixed seeds?

Set PYTHONHASHSEED before process start, then seed random, NumPy, torch.manual_seed, and torch.cuda.manual_seed_all, and enable cuDNN deterministic mode. Also pass an explicit generator and worker_init_fn to DataLoader, and record device, dtype, and known nondeterministic operators in the run manifest.

What tests should I write before implementing experiment code?

Write gold tests with hand-computable answers, property tests with Hypothesis for invariants like range and finiteness, metamorphic tests for output relations under input permutations, and train-only-fit tests proving transformers never see test data. Watch them fail first, then write the minimal implementation to pass.

Does passing a static leakage scan prove my experiment has no leakage?

No. Static AST and regex scanning only detects code-level patterns like fitting before splitting and can miss or misreport cases. The same applies to seed audits: matching two same-seed runs only supports same-environment reproducibility, not cross-hardware or cross-platform guarantees.

Why should failed experiment runs be kept instead of deleted?

Failed runs preserve failure artifacts, exit codes, and stdout/stderr needed to classify root causes such as OOM, timeout, or code bugs. Deleting or overwriting them destroys auditability, and downstream result analysis must be able to recompute findings from complete raw evidence.