ab-test-design
Skill0 starsChanged 6 months agoMITView on GitHub
Designs A/B tests with power analysis, minimum detectable effect (MDE), sample size estimation, randomization unit selection, guardrail definition, and a pre-registration checklist. Use when the user mentions experiment design, A/B test setup, power analysis, sample size, MDE, pre-registration, randomization, or asks "how should I run this experiment.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- RBraga01/builder-producttheir own version, first seen Jun 7, 2026
- Mehdibargach/claude-code-pm-skillstheir own version, first seen Mar 18, 2026
- nandanosql/all_in_one_pm_skillstheir own version, first seen Feb 28, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Mehdibargach/claude-code-pm-skills★ 97same name
- RBraga01/builder-product★ 2same name
- nandanosql/all_in_one_pm_skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- ab-test-analysisSkill
- causal-inferenceSkill
- cohort-analysisSkill
- data-quality-auditSkill
- funnel-analysisSkill
- linear-regressionSkill
- logistic-regressionSkill
- metric-definitionSkill
- modular-sql-ctesSkill
- sql-correctness-reviewSkill
- sql-query-reviewSkill
- stakeholder-readoutSkill
- survival-analysisSkill
- warehouse-query-optimizationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use when the user is planning an experiment, not analyzing one.
- Very specific: line 18
If the user already has results, use ab-test-analysis instead.
- Distinctive: line 43
Set MDE conservatively: Default to the smallest effect the team would actually act on.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
A/B Test Design
When to use this skill
Use when the user is planning an experiment, not analyzing one. Triggers include:
- "Design an A/B test for…"
- "What sample size do I need…"
- "How long should I run this test…"
- "Pre-register this experiment"
- "Pick guardrails for…"
If the user already has results, use ab-test-analysis instead.
Required inputs
Collect these before computing anything. If missing, ask.
| Input | Why it matters |
| Primary metric | Determines test type (proportion, mean, ratio) |
| Baseline rate or mean | Required for power calculation |
| Minimum detectable effect (MDE) | Sets sensitivity floor |
| Randomization unit | User, session, account, device |
| Expected daily exposure (units/day) | Determines runtime |
| Variant count (control + N treatments) | Affects multiple-comparison correction |
| Guardrail metrics | What must not regress |
Workflow
- Confirm hypothesis is testable. A hypothesis has the form: "Changing X will move metric Y by at least Z%, because reason R." If reason R is missing, push back.
- Pick the metric type.
- Binary outcome (conversion, click) -> proportion test
- Continuous (revenue per user, session length) -> mean test, log-transform if skewed
- Ratio (revenue per impression) -> delta method or bootstrap
- Set MDE conservatively. Default to the smallest effect the team would actually act on. Do not optimize MDE to fit the runtime — that's how teams ship noise.
- Compute sample size using
scripts/sample_size.py. Default to alpha=0.05, power=0.80, two-sided. - Compute runtime = (sample size per arm × num arms) / daily exposure. Round up to a full business cycle (e.g., 14 days minimum to capture weekday/weekend variance).
- Define guardrails. Minimum three:
- One business guardrail (e.g., revenue/user must not drop > X%)
- One quality guardrail (e.g., error rate, latency)
- One reach guardrail (assignment ratio sanity check, sample ratio mismatch)
- Write pre-registration doc using the template below.
Output format
Produce a pre-registration block:
# Experiment Pre-Registration: <name>
## Hypothesis
Changing <X> will move <Y> by at least <Z>%, because <R>.
## Variants
- Control: <description>
- Treatment 1: <description>
- (Treatment 2: <description>)
## Randomization
- Unit: <user | session | account>
- Allocation: <e.g., 50/50, 33/33/33>
## Metrics
- Primary: <metric name, definition, source table>
- Secondary: <list>
- Guardrails: <list with thresholds>
## Power
- Baseline: <value>
- MDE: <value> (absolute / relative)
- Alpha: 0.05
- Power: 0.80
- Required sample per arm: <N>
- Expected daily exposure per arm: <N/day>
- Minimum runtime: <D days> (≥ 14 days to cover one weekly cycle)
## Stopping rules
- No peeking before <date>
- Stop early only on guardrail breach (specify threshold)
## Analysis plan
- Test: <z-test / t-test / Mann-Whitney / CUPED-adjusted>
- Subgroup analyses (pre-specified): <list or "none">Validation checks
Before finalizing, verify:
- Primary metric has a single, unambiguous SQL definition
- Randomization unit matches the unit at which the treatment is delivered
- Runtime covers at least one full weekly cycle
- Sample ratio mismatch (SRM) check is part of the analysis plan
- Guardrails have explicit thresholds and stop-the-experiment rules
- No more than 1 primary metric (multiple primaries inflate false positives)
Edge cases & failure modes
- Network effects (marketplaces, social): user-level randomization leaks treatment. Use cluster randomization (geo, cohort) or switchback designs.
- Very rare events (< 1% base rate): sample size explodes. Consider proxy metrics or longer runtime.
- Long conversion windows: define the observation window explicitly. A "7-day conversion" experiment running 7 days has no fully-observed users yet.
- Novelty / primacy effects: plan a 14-day minimum and discard the first 2-3 days from analysis if needed (pre-specify this).
Scripts
scripts/sample_size.py— Sample size calculator for proportion and mean tests.
python scripts/sample_size.py --metric-type proportion --baseline 0.12 --mde 0.01 --alpha 0.05 --power 0.80
python scripts/sample_size.py --metric-type mean --baseline-mean 45.2 --baseline-std 18.4 --mde 2.0Related skills
ab-test-analysis— read out results after the experiment runsmetric-definition— write precise specs for primary and guardrail metricscausal-inference— for situations where RCT isn't feasible
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.

