agentleFS
vermapragyavermapragya/analytics-skill/skills/ab-test-analysis/SKILL.md

ab-test-analysis

Skill0 starsChanged 6 months agoMITView on GitHub

Analyzes A/B test results with significance testing, confidence intervals, sample ratio mismatch check, guardrail evaluation, and a stakeholder-ready readout. Use when the user mentions A/B test results, experiment readout, test analysis, lift, significance, p-value, treatment vs control, or asks "did the experiment work.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 7

    Distinctive

    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
  1. Very specific:

    If the experiment is still being planned, use ab-test-design.

    line 18
  2. Distinctive:

    If pre-registration is missing, flag it loudly in the readout.

    line 30
  3. Distinctive:

    Verify variant labels match the design

    line 35
  4. Distinctive:

    Check date range matches the experiment window

    line 37
  5. Distinctive:

    If p < 0.001, stop. SRM means broken assignment — results are invalid.

    line 43
  6. Distinctive:

    Peeking: if the user asks for an analysis before planned sample size, refuse to make a ship decision.

    line 134
  7. Distinctive:

    Multiple primary metrics: if there are more than one, you cannot ship on "any" being significant.

    line 136
  8. Distinctive:

    Day-of-week effects: if runtime isn't a multiple of 7 days, day-of-week imbalance can bias results.

    line 138

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

A/B Test Analysis

When to use this skill

The experiment has finished (or has reached planned sample size) and the user needs to interpret the results. Triggers:

  • "Analyze this experiment…"
  • "Did the test win?"
  • "Was the lift significant?"
  • "Write a readout for experiment X"
  • "Compare treatment vs control on…"

If the experiment is still being planned, use ab-test-design.

Required inputs

InputFormat
Per-unit assignment dataunit_id, variant, metric_value (or aggregate)
Variant labelsWhich is control
Primary metric definitionFrom the pre-registration
Guardrail metricsFrom the pre-registration
Test designSample size targets, MDE, allocation

If pre-registration is missing, flag it loudly in the readout. Post-hoc analysis without a pre-reg should be labeled exploratory.

Workflow

  1. Sanity check the data.
    • Verify variant labels match the design
    • Confirm there's exactly one record per unit per variant
    • Check date range matches the experiment window
    • Strip any users who appeared in multiple variants (assignment errors)
  2. Run Sample Ratio Mismatch (SRM) check.
    • Compute observed vs expected ratio
    • χ² test against design allocation
    • If p < 0.001, stop. SRM means broken assignment — results are invalid.
  3. Compute primary metric per variant.
    • Point estimate
    • 95% confidence interval (use bootstrap for ratio metrics)
    • Absolute lift and relative lift vs control
  4. Test significance.
    • Proportion: two-proportion z-test
    • Mean: Welch's t-test
    • Ratio: delta method or bootstrap
    • Report p-value AND CI (CI is more useful than p-value alone)
  5. Evaluate guardrails. Each guardrail gets one of three statuses:
    • PASS — within threshold with 95% confidence
    • WATCH — point estimate breaches but CI overlaps zero
    • FAIL — CI clears the threshold in the wrong direction
  6. Decision recommendation. Apply this matrix:
PrimaryGuardrailsRecommendation
Significant winAll PASSShip
Significant winAny WATCHShip + monitor the WATCH metric
Significant winAny FAILHold — investigate guardrail tradeoff
Not significant, CI excludes MDEAll PASSNo ship — effect smaller than MDE
Not significant, CI includes MDEAll PASSInconclusive — extend or kill
Negative significant—Kill the treatment
  1. Write the readout using the template below.

Output format

# Experiment Readout: <name>

## TL;DR
**Recommendation:** <Ship | Hold | Kill | Inconclusive>

<Primary metric> changed by <X%> ([<low>, <high>] 95% CI, p=<value>) over <N> days.

## Sample Ratio Mismatch
| Variant | Expected | Observed | Delta |
|---|---|---|---|
| Control | 50.0% | 49.8% | -0.2pp |
| Treatment | 50.0% | 50.2% | +0.2pp |

χ² p-value: <value> — **<PASS|FAIL>**

## Primary metric: <name>
| Variant | N | Value | 95% CI |
|---|---|---|---|
| Control | <N> | <val> | [<low>, <high>] |
| Treatment | <N> | <val> | [<low>, <high>] |

- Absolute lift: <X> ([<low>, <high>])
- Relative lift: <X%> ([<low>, <high>])
- Test: <z-test | t-test | bootstrap>, p = <value>

## Guardrails
| Metric | Threshold | Result | Status |
|---|---|---|---|
| <metric> | <threshold> | <delta + CI> | <PASS|WATCH|FAIL> |

## Subgroup analysis (pre-specified only)
<table or "No pre-specified subgroups">

## Decision
<Ship | Hold | Kill | Inconclusive>, because <reason>.

## Caveats
- <pre-registration deviations if any>
- <data quality notes>
- <known confounds>

## Next steps
- <action 1>
- <action 2>

Validation checks

  • Total sample reached the pre-registered target
  • SRM check ran and passed
  • Confidence interval reported (not just p-value)
  • All pre-registered guardrails evaluated
  • Any subgroup analysis flagged as pre-specified vs exploratory
  • Recommendation matches the decision matrix

Edge cases & failure modes

  • Peeking: if the user asks for an analysis before planned sample size, refuse to make a ship decision. Compute confidence intervals only and label "interim — do not act on this."
  • One-sided tests: convert to two-sided unless pre-registered as one-sided. Two-sided is the default.
  • Multiple primary metrics: if there are more than one, you cannot ship on "any" being significant. Either pick one or apply Bonferroni correction.
  • Heavy-tailed metrics (revenue): trimmed mean (winsorize at 99th percentile) is often more robust than raw mean. Note this in caveats.
  • Day-of-week effects: if runtime isn't a multiple of 7 days, day-of-week imbalance can bias results. Note in caveats.

Scripts

  • scripts/analyze_experiment.py — End-to-end analysis from a CSV of unit_id, variant, metric_value.
python scripts/analyze_experiment.py \
    --input results.csv \
    --metric-type proportion \
    --control-label control \
    --treatment-label treatment

Related skills

  • ab-test-design — pre-experiment planning
  • metric-definition — clarify guardrail thresholds
  • stakeholder-readout — for non-experiment analyses needing similar structure
  • causal-inference — when randomization is broken or unavailable

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.