agentleFS
sankar2codesankar2code/Claude-Skill_SubAgent-Builder-Collections/skills/experiment-design/SKILL.md

experiment-design

Skill2 starsChanged 36 days agoMITView on GitHub

Designs a trustworthy A/B test (or a quasi-experiment when randomizing isn't possible): hypothesis, primary and guardrail metrics, randomization unit, minimum detectable effect, sample size and duration, and decision rules written down before launch. Use this skill when the user says "design an A/B test", "how long should this test run", "how many users do I need", "is this test big enough", "set up an experiment", "test this feature", or "how do we measure the impact of this launch". Part of the Product Analytics pack.

31 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use list-quality-scorecard and positive-reply-scoring.

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.
  • creatop-gtmSkill

    list-quality-scorecard

    Check a lead list before it goes into a sequence. Gives a deliverability readout (firm) and a targeting readout (advisory). Surfaces issues, never blocks. Use before enrolling any list.

    Also in 3 projects that use this

  • creatop-gtmSkill

    positive-reply-scoring

    Classify replies and compute positive reply rate, the metric that predicts revenue. Use to tell whether a campaign is actually working, not just getting replies.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 22 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write it in this form:

    line 21
  2. Distinctive:

    If the user can't state the reason, the test may be premature.

    line 25
  3. Distinctive:

    Write the exact definition and the analysis unit of each.

    line 33
  4. Distinctive:

    Interference: if treated users affect control users (marketplaces, social features, shared inventory), use cluster or geo randomization, or …

    line 40
  5. Very specific:

    Run scripts/sample_size.py (in this skill's folder) to compute it and the duration:

    line 54
  6. Distinctive:

    Run whole weeks (at least one, usually two) so weekday and weekend behavior are both covered.

    line 62
  7. Distinctive:

    If the required duration is more than about 4–6 weeks, the MDE is too small for the traffic.

    line 63
  8. Distinctive:

    Peeking: don't stop as soon as p < 0.05.

    line 76
  9. Distinctive:

    Sample ratio mismatch (SRM): check the actual split matches the planned split (chi-square test).

    line 77
  10. Distinctive:

    Instrumentation: verify events fire correctly in both groups before launch (an A/A test helps).

    line 80
  11. Distinctive:

    Use the strongest available alternative, and say how strong the evidence is:

    line 84
  12. Distinctive:

    Regression discontinuity: when eligibility depends on a cut-off (e.g.

    line 88
  13. Very specific:

    After the test, suggest insight-storyteller to write the readout.

    line 107

“Common” is measured: kept by at least 6 in 10 of the 22 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

Product Analytics pack · Stage 4. analytics-question-framing → metric-root-cause / cohort-retention → opportunity-sizing → experiment-design → insight-storyteller

Experiment Design

The most expensive experiment is one that runs for weeks and then can't answer the question. Design it so the result, whatever it is, leads to a decision.

Step 1 — Hypothesis

Write it in this form:

If we <change> for <population>, then <primary metric> will <increase/decrease> by at least <MDE>, because <reason>.

If the user can't state the reason, the test may be premature. Say so.

Step 2 — Metrics

  • Primary metric (one): the metric the decision rests on. It must move within the test window and be sensitive to the change.
  • Guardrail metrics (2–4): things that must not get worse: revenue, latency, errors, unsubscribes, support tickets, a key downstream step.
  • Secondary metrics: to understand why, not to decide.

Write the exact definition and the analysis unit of each.

Step 3 — Randomization

  • Unit: user, account, session, or region. Use the unit at which the experience is consistent. If users in one account share an experience, randomize by account.
  • Split: 50/50 unless risk calls for a smaller treatment group.
  • Eligibility: who enters the test and at what moment (trigger the assignment when the user first reaches the changed experience, not at login, to avoid diluting the effect).
  • Interference: if treated users affect control users (marketplaces, social features, shared inventory), use cluster or geo randomization, or a switchback design.

Step 4 — Sample size and duration

Choose the minimum detectable effect (MDE): the smallest change worth acting on (use opportunity-sizing to decide what's worth it). Use 95% confidence (α = 0.05, two-sided) and 80% power unless there's a reason not to.

For a conversion-rate metric, sample size per group:

n = (z₁₋α/₂ + z₁₋β)² × [p₁(1−p₁) + p₂(1−p₂)] / (p₂ − p₁)²

For a mean metric with standard deviation σ and absolute effect δ: n = 2 × (z₁₋α/₂ + z₁₋β)² × σ² / δ².

Run scripts/sample_size.py (in this skill's folder) to compute it and the duration:

python scripts/sample_size.py --baseline 0.12 --mde-rel 0.05 --daily-users 8000
python scripts/sample_size.py --mean 42 --sd 30 --mde-abs 1.5 --daily-users 8000

Duration rules:

  • Run whole weeks (at least one, usually two) so weekday and weekend behavior are both covered.
  • If the required duration is more than about 4–6 weeks, the MDE is too small for the traffic. Raise the MDE, pick a more sensitive metric, or use a variance-reduction method such as CUPED (adjusting for each user's pre-period value).

Step 5 — Decision rules (write before launch)

ResultDecision
Primary metric up significantly, no guardrail harmedShip
Primary metric flat (confidence interval within ±MDE)Don't ship for this reason; keep only if it has other value
Primary metric down, or a guardrail significantly harmedDon't ship; investigate
Inconclusive (interval wide, crosses MDE)Extend only if pre-planned; otherwise treat as flat

Step 6 — Pitfalls to guard against

  • Peeking: don't stop as soon as p < 0.05. Fix the duration up front, or use a sequential testing method designed for repeated looks.
  • Sample ratio mismatch (SRM): check the actual split matches the planned split (chi-square test). A mismatch means assignment or logging is broken, so don't trust the result.
  • Novelty effects: new UI can spike engagement briefly. Compare week 1 to week 2.
  • Multiple comparisons: many metrics or segments will produce false positives. Decide on the primary metric and key segments in advance.
  • Instrumentation: verify events fire correctly in both groups before launch (an A/A test helps).

When you can't randomize

Use the strongest available alternative, and say how strong the evidence is:

  • Difference-in-differences: compare the change in the treated group with the change in a similar untreated group over the same period. Check the two trended in parallel beforehand.
  • Staggered rollout: release region by region and compare regions that have it with those that don't yet.
  • Regression discontinuity: when eligibility depends on a cut-off (e.g. accounts above 50 seats).
  • Pre/post: the weakest; only with a long, stable baseline and no other changes in the window.

Output: experiment plan

# Experiment plan: <name>
**Hypothesis:** If we … then … by at least … because …
**Primary metric:** <definition> · **Guardrails:** <list>
**Unit / split / trigger:** <user, 50/50, on first visit to …>
**Baseline:** <value> · **MDE:** <abs and relative> · **α / power:** 0.05 / 0.80
**Sample size:** <n per group> · **Duration:** <weeks> at <daily eligible users>
**Decision rules:** <table>
**Checks:** SRM, A/A or event QA, novelty review
**Owner and readout date:** <…>

When done

After the test, suggest insight-storyteller to write the readout.

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.