experiment-structure
Skill2 starsChanged 7 months agoApache-2.0View on GitHub
Use when the user starts a new experiment, asks "how should I organize this", "where should X live", "scaffold an experiment folder", or when other skills (podman-runner, experiment-report, marimo-figures) need a canonical layout to write into. Lays down a reproducible directory structure and the rules that keep it honest. Do not invoke to reorganize an existing, working project without the user's explicit ask.
In this repository5 other files it gives its agents.
- dataset-insightsSkill
- experiment-reportSkill
- marimo-figuresSkill
- plan-pi-fleshoutSkill
- podman-runnerSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Do not restructure an existing project unless the user explicitly asks.
- Very specific: line 130
Seeds: Every run sets a seed and writes it to config.yaml under seed: <int>.
- Distinctive: line 155
When the user says "scaffold", create:
- Very specific: line 175
Don't scaffold src/, tests/, or scripts/ contents — those are code decisions the user hasn't made yet.
- Distinctive: line 180
Before making non-trivial changes to an existing experiment folder:
- Distinctive: line 183
If not, git init and commit the current state first.
- Very specific: line 184
Create a worktree off main (or the folder's default branch) for the change: git worktree add ../<folder>-<slug> -b exp/<slug>.
- Distinctive: line 186
Run the experiment and write its outputs inside the worktree.
- Distinctive: line 196
Don't nest experiments inside experiments.
- Very specific: line 198
Don't commit data/raw/ or runs/ to git — use DVC, S3, or a shared filesystem.
- Very specific: line 201
Don't mix analysis (analysis/) and publication-ready figures (figures/).
- Very specific: line 204
Don't let scripts/ grow logic.
≈ “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.
Files
experiment-structure
Canonical folder layout for a computational experiment and the conventions that keep it reproducible. The other four skills in this repo write into this layout; don't invent a different one on the fly.
When to use
- The user says "I'm starting a new experiment" or "scaffold a folder for this".
- Another skill (
podman-runner,experiment-report,marimo-figures,dataset-insights) needs a destination directory and none exists. - The user asks "where does X go?" — answer from this file, don't guess.
Do not restructure an existing project unless the user explicitly asks. Migrations are expensive; the cost of a slightly-off layout is usually lower than the cost of moving everything.
The layout
<experiment-name>/
├── README.md # one-page "what & why" of the whole experiment
├── pyproject.toml # or environment.yml — pinned dependencies
├── Containerfile # consumed by podman-runner
├── .gitignore
│
├── configs/ # every parameter the experiment varies
│ ├── base.yaml # defaults, committed
│ ├── sweep-lr.yaml # overrides for a specific run family
│ └── ...
│
├── src/ # importable library code (no side effects on import)
│ └── <project>/
│ ├── __init__.py
│ ├── data.py
│ ├── models.py
│ └── train.py
│
├── scripts/ # entry points; thin wrappers over src/
│ ├── train.py
│ ├── eval.py
│ └── prepare_data.py
│
├── data/ # inputs
│ ├── raw/ # read-only, never modified, gitignored
│ ├── interim/ # cleaned/filtered, reproducible from raw
│ └── processed/ # model-ready, reproducible from interim
│
├── runs/ # one directory per run, immutable after creation
│ └── <run-id>/
│ ├── config.yaml # the exact config used (resolved, not templated)
│ ├── git.txt # commit hash + dirty flag
│ ├── env.txt # `pip freeze` or `uv pip freeze`
│ ├── logs/ # stdout, stderr, per-step logs
│ ├── checkpoints/ # model state
│ ├── metrics.json # or metrics.parquet — the numbers
│ └── README.md # (optional) what this run was trying to answer
│
├── analysis/ # post-hoc exploration; outputs of dataset-insights
│ └── <slug>/
│ ├── profile.md
│ ├── insights.md
│ └── figures/
│
├── figures/ # publication-ready figures; outputs of marimo-figures
│ ├── <slug>.py # marimo notebook
│ └── <slug>.png
│
├── reports/ # outputs of experiment-report
│ └── <slug>.md
│
└── tests/ # pytest — smoke tests over src/ and scripts/Hard rules
These are non-negotiable. If you find yourself wanting to break one, stop and ask the user first.
data/raw/is read-only. Nothing writes to it except the initial ingest. If you clean the data, write todata/interim/.runs/<id>/is immutable after the run exits. You may append analysis notes toruns/<id>/README.md, but never rewriteconfig.yaml,metrics.json, or checkpoints. A new run gets a new id.- Every run captures provenance.
git.txt(commit + dirty flag),env.txt(frozen deps), andconfig.yaml(fully resolved, not templated) are required.podman-runnerwrites these automatically; if you're running manually, write them yourself. - Scripts are thin.
scripts/train.pyparses a config path, imports fromsrc/, and calls a function. All logic lives insrc/. This keeps the library testable and the entry points boring. - Configs over flags. Hyperparameters live in
configs/<name>.yaml. Scripts take--config <path>and maybe--override key=valuefor one-offs. Do not spread flags across argparse calls that you'll regret when you try to reproduce the run six months from now. - Figures and reports reference runs, not the other way around.
A figure in
figures/names the run it summarizes; a run never refers to the figures built from it (those come later). - Experiment folders are git repos, and work happens in
worktrees. On first touch,
git initthe folder if it isn't already a repo. For any change beyond a trivial scaffold edit — new runs, new analyses, new figures, new reports — create a worktree (git worktree add ../<folder>-<slug> -b exp/<slug>) and work there. The main checkout stays clean so parallel experiment branches don't contaminate each other.
Soft conventions
These are defaults — override with a reason.
- Run id format.
YYYY-MM-DD-HHMM-<short-slug>(e.g.2026-04-17-0830-lr-sweep-v2). Sortable and human-readable; no UUIDs unless a sweep tool generates them. - Config format. YAML. One file per named configuration.
Overrides for sweeps go in their own file that
includes: base.yamlat the top. - Metrics schema.
metrics.jsonis a flat dict of{"metric_name": float}for scalars;metrics.parquetfor time-series or per-step logs. - Seeds. Every run sets a seed and writes it to
config.yamlunderseed: <int>. Default to seed 0 only if the user is explicitly prototyping. - Tests.
tests/mirrorssrc/. One smoke test per script that runs it on a 10-row fixture so CI catches the "import broke on main" class of bug.
What lives where — quick reference
| I have a... | Put it in... |
| hyperparameter | configs/<name>.yaml |
| reusable function | src/<project>/ |
| CLI entry point | scripts/ |
| new data file someone sent me | data/raw/ |
| cleaned-up version of that | data/interim/ |
| model-ready tensors | data/processed/ |
| output of a single training run | runs/<id>/ |
| exploratory analysis of a dataset | analysis/<slug>/ |
| figure that belongs in a writeup | figures/<slug>.{py,png} |
| writeup of a run | reports/<slug>.md |
| smoke test | tests/ |
Scaffolding a new experiment
When the user says "scaffold", create:
- The directory tree above (empty except the top-level files).
- A minimal
README.mdthat states the question the experiment is meant to answer (one paragraph). Push back if the user can't state the question — a nameless experiment is a scope-creep vector. - A minimal
configs/base.yamlwith placeholder keys for the parameters the user mentioned. - A minimal
pyproject.tomlpinning the stack the user named (or sensible defaults:python >= 3.11,numpy,polars,pytest,ruff). - A
.gitignorethat coversdata/raw/,runs/,__pycache__/,.venv/,*.egg-info/. - An empty
Containerfilewith aFROM python:3.11-slimstarter and a# filled in by podman-runner skillcomment. git initin the folder and an initial commit of the scaffold so later work can branch cleanly. Then create a worktree (git worktree add ../<name>-<slug> -b exp/<slug>) for the first real change and do the work there rather than on the main checkout.
Don't scaffold src/, tests/, or scripts/ contents — those are
code decisions the user hasn't made yet.
Working on an existing experiment folder
Before making non-trivial changes to an existing experiment folder:
- Confirm it's a git repo (
git rev-parse --is-inside-work-tree). If not,git initand commit the current state first. - Create a worktree off
main(or the folder's default branch) for the change:git worktree add ../<folder>-<slug> -b exp/<slug>. - Run the experiment and write its outputs inside the worktree. Merge (or leave as a branch) only once the run is finished and provenance is captured.
This applies when other skills (podman-runner, experiment-report,
marimo-figures, dataset-insights) are about to mutate the folder
too — prepare the worktree first, then hand off.
What not to do
- Don't nest experiments inside experiments. If work branches, create a sibling directory.
- Don't commit
data/raw/orruns/to git — use DVC, S3, or a shared filesystem. The repo tracks code that reproduces those directories. - Don't mix analysis (
analysis/) and publication-ready figures (figures/). Analysis is exploratory and allowed to be messy; figures are tracked, reviewed, and referenced in reports. - Don't let
scripts/grow logic. Push it intosrc/the moment you copy-paste anything between two scripts.
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
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.

