agentleFS
samuhssamuhs/mad-science/skills/expectation-driven-science/SKILL.md

expectation-driven-science

Skill1 starsChanged 13 days agoMITView on GitHub

Development guided by the scientific method and explicit expectations. Use when the user wants to build or validate an analysis/model test-first, states a "hypothesis", "expectation" or "assumption" about the data, or asks for a principled data-science workflow (hypothesis → prediction → verification).

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When exploring the domain, read the project's context documentation (if it exists) so hypothesis names, metrics, and interfaces match the …

    line 10
  2. Distinctive:

    Ask: "What is the business question, and at which seams should we declare an expectation?" Give each proposed seam a one-line note on what …

    line 32

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

Expectation-Driven Science

This is the discipline that turns data exploration from an implicit process into a verifiable hypothesis → prediction → verification loop. It is the data-science equivalent of TDD's red→green: the same root principle — put the expectation before the trust — applied to three distinct objects (hypothesis in the business, premise in the data, function in the code). This skill is the reference that makes that loop produce analyses worth keeping: what a good expectation is, where it lives, the anti-patterns, and the rules of the loop.

When exploring the domain, read the project's context documentation (if it exists) so hypothesis names, metrics, and interfaces match the business domain language, and respect the ADRs in the area you're touching.

What a good expectation (hypothesis/prediction) is

An expectation declares what the observer believes to be true about the world before looking at the data, and can therefore be confirmed or refuted. It reads like a research question: "customers with abandoned carts have lower long-term savings" tells you exactly which relationship you're testing — and it survives model swaps, column changes, or tool changes, because it depends on the relationship of interest, not on the internal mechanism of implementation.

A good expectation must be falsifiable (it can be proven wrong) and quantifiable (it has a threshold/acceptance limit defined before running). When the expectation fails, treat the deviation as information, not failure. See the Rule of the loop below.

Seams: where expectations live

A seam is the object on which you declare an expectation — the point where you observe reality without "reaching inside" it. Expectations live at seams, never against internal details.

Only declare expectations at pre-agreed seams. Before writing any hypothesis, write down the seams under test and confirm them with the user. No expectation is written at an unconfirmed seam. You can't test everything, so agreeing the seams up front is how verification effort lands on the critical hypotheses and complex logic instead of every edge case.

There are three seam families, aligned with the three layers on which a data scientist relies:

SeamObject of the expectationWhat to expect (examples)
Business hypothesisCausal/associative relations in the domain"3-month retention increase → higher LTV"
Data premiseData state/quality/schema"created_at never null", "ratio ≥ 0", "schema versioned"
Function/pipelineCode behavior (~TDD)"the imputer preserves the mean", "transformation is idempotent"

Ask: "What is the business question, and at which seams should we declare an expectation?" Give each proposed seam a one-line note on what it catches and what it misses.

When the shape of the question itself is in question (what the analysis intends to prove, where the hypothesis boundary lies, which metric is the source of truth), refine the hypothesis before declaring expectations — the clarity of the question decides the usefulness of every verification that follows.

Anti-patterns

  • Hindsight (post-hoc rationalization): the prediction is written after seeing the result, so it always "matches". The tell: the expectation shapes itself to the data instead of the data judging the expectation. Expected values must come from an independent source of truth — prior knowledge, literature, a definition set before the experiment, or domain understanding — not by re-deriving what the data itself showed.
  • Tautological: the deviation is computed the same way the analysis computes it (e.g. expecting mean == sum/n), so it passes by construction. The source of truth must be external: a known benchmark, a domain reference value, a hand-worked case.
  • Horizontal slicing: declaring all hypotheses first, then running all of them. Bulk verifications test imagined relationships: you test the shape of things rather than the behavior of interest, the expectations go insensitive to real changes, and you commit to a structure before understanding the data. Work in vertical slices instead: one hypothesis → one verification → iterate, each slice a tracer bullet that responds to what the last cycle taught you.

Rules of the loop

  • Expectation before trust (red). Declare the hypothesis/prediction before looking at the result and running the verification, then only enough analysis/pipeline to pass it. Don't anticipate future hypotheses or add speculative checks.
  • One slice at a time. One seam, one expectation, one minimal verification per cycle.
  • Refactoring is not part of the loop. It belongs to the review stage (see the code-review skill), not the hypothesis loop.
  • Deviation is information, not failure. When the expectation fails, the next step is not "make it pass at all costs": it is to investigate whether the deviation is (a) bad data / pipeline error, or (b) a wrong premise by the scientist. Classifying correctly decides whether the fix is technical or whether the expectation needs to be revised with justification.
  • Separate exploratory from confirmatory. Exploratory discovers hypotheses and is free-form; confirmatory tests hypotheses and is rigid (expectation pre-registered before collection). Don't treat exploratory analysis as confirmatory — that classic error fabricates conclusions without support.

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.