A/B test designer

Turns "let's test it" into a one-page plan the team signs before launch: what changes, for whom, which single metric decides, what must not get worse, the smallest effect worth acting on, how many users and how many full weeks that takes, and when the test is read. Most failed tests were lost at the design stage: too little traffic, a metric too far from the change, a decision taken the day the chart looked good. This skill fixes those before a line of code is written, and it will tell you not to test when the numbers can't produce an answer.

Any agentBy SlateMIT licencev1.0.0

Add it to your agent

npx skills add slatehq-repo/marketing-skills --skill ab-test-designer

Works in Claude Code, Cursor, Codex and other agents that read skills. Or copy the skill into your agent's skills folder (for Claude Code, .claude/skills/ab-test-designer/).

DownloadView on GitHub

When to use

  • "Set up an A/B test for …", "how long should this test run", "how many visitors do we need", "sample size", "is this worth testing", "split test plan", "test plan for our headline / form / pricing page / onboarding".
  • Website, product, email-landing and in-app tests where users can be randomly split.
  • Not for reading a finished test: use experiment-results-readout. Not for choosing which ideas to test: use growth-experiment-backlog.
  • Not for measuring what a whole channel adds: use incrementality-test. Not for ad creative tests inside ad platforms: use paid-social-test-plan.

What you need

Required:

  • The change and the reason: what will differ, and the evidence that suggests it will help (an audit finding, analytics, customer quotes).
  • Baseline: the primary metric's current rate over the last 4 weeks, ideally per user from the testing or product analytics tool.
  • Traffic at the test point: users per day who would see the change (not site-wide traffic).

Ask for, or assume and state:

  • Smallest effect worth acting on: the lift that would justify shipping and maintaining the change. If unknown, work it out with the user from the value of a conversion; don't just use whatever the traffic can detect.
  • Variants: default one control and one variant.
  • The testing tool and its statistics: fixed sample, sequential or Bayesian. Its rules for stopping override generic ones.
  • Guardrails: what must not get worse (lead quality, revenue per visitor, refunds, errors, page speed).
  • Calendar: launches, campaigns, holidays and other tests on the same page or users.

Data and tools

  • In Slate: Pages and site analytics give GA4 sessions and key events per page, by channel and per day, for a first estimate of the baseline and daily traffic. Sheets keep the team's test log: plan, dates, decision. GA4 counts sessions and events, while testing tools split users, so treat GA4 numbers as an approximation and prefer user-level counts from the testing tool.
  • With the Slate MCP server: query_pages with view: "list", search set to the page path and date_range with start and end for exactly four weeks, plus filters.channel_group if only one channel will see the test; query_pages with view: "timeseries", the page_id and preset: "90d" for daily sessions and the weekly pattern; create_sheet, edit_sheet_rows and get_sheet_rows for the test log.
  • Without Slate: an analytics or product analytics export for the baseline and traffic, the testing tool's own calculator, or a free online sample-size calculator such as Evan Miller's.

Procedure

  1. Check the test is worth running. Don't test defects (fix them), changes nobody would reverse whatever the result, or decisions already made. Write what the team will do if the variant wins, loses, or shows nothing; if all three lead to the same action, don't test.
  2. Write the hypothesis. "Because <evidence>, changing <element> for <audience> will <increase/decrease> <primary metric>, because <reason>." One change, or one coherent package of changes tested together and named as a package.
  3. Choose the unit. Randomise users (a stable cookie or user ID), not page views or sessions, so a person sees one version throughout. Logged-in products: randomise accounts when teammates see each other's screens.
  4. Define one primary metric precisely. Numerator, denominator, window and counting rule: "users who submit the demo form within 7 days of first exposure ÷ users exposed, one conversion per user". Choose the metric closest to the change that still matters to the business. A metric several steps away (paid conversion after a homepage headline change) needs far more traffic; use it as a guardrail instead.
  5. Set two to four guardrails with thresholds. For example "demo-to-meeting rate not lower by more than 10% relative", "page errors not higher". A guardrail breach stops the test or blocks shipping.
  6. Set the minimum detectable effect (MDE). The smallest relative lift worth shipping, agreed with the user. Smaller effects need many more users: halving the MDE roughly quadruples the sample.
  7. Compute the sample size. Per variant, at 95% confidence (two-sided) and 80% power: n = 7.84 × [p1(1 − p1) + p2(1 − p2)] ÷ (p2 − p1)², where p1 is the baseline and p2 = p1 × (1 + MDE). Adjust for more than two variants, uneven splits and revenue metrics. Formula, worked example and a lookup table: references/sample-size.md. Show the numbers so anyone can check them.
  8. Compute the run time. Days = (n × number of variants) ÷ users per day at the test point. Round up to whole weeks, with a minimum of two weeks so every weekday appears at least twice. If it exceeds six weeks, don't run it as designed: test a bolder change, move to a page with more traffic, choose a closer primary metric, drop a variant, or accept a larger MDE; show the MDE the traffic can detect in four weeks.
  9. Fix the stopping rule. Fixed-sample tests are read once, on the planned date, after the planned sample. Don't stop because the dashboard shows "significant" on day five; looking repeatedly and stopping at the first good reading inflates false wins. The only early stops are for bugs, a sample ratio mismatch, or a guardrail breach. If the tool uses sequential or Bayesian methods, follow its stopping rule and write it into the plan.
  10. Write the QA and launch list. Both versions render correctly on main browsers and phones, with no flash of the old version; the primary metric and guardrails fire in both arms; internal and bot traffic excluded; the split matches the plan after the first day (check the sample ratio); no other test or page change overlaps; campaigns and holidays noted. Hand the plan to experiment-results-readout for the read.

Output

## Test plan: <name>, <date>
Owner: <name>. Page or flow: <where>. Tool: <tool, stats method>.

Hypothesis: Because <evidence>, changing <element> for <audience> will <direction> <metric>, because <reason>.
Variants: A (control) <description>; B <description>. Split: <50/50>. Unit: <user / account>.

Primary metric: <numerator ÷ denominator, window, counting rule>. Baseline: <rate, source, window>.
Guardrails: <metric: threshold> · <metric: threshold>
MDE: <relative %> (<p1> → <p2>). Reason: <why this size matters>.

Sample: <n> users per variant (<formula or calculator>). Traffic at test point: <users/day>.
Run time: <days> → <weeks> full weeks. Start <date>, read <date>.
Stopping rule: <fixed sample, single read on the date / tool's sequential rule>. Early stop only for bugs, sample ratio mismatch or guardrail breach.

Decision rules: ship if <…>; keep control if <…>; if inconclusive <…>.
QA checklist: <items, ticked before launch>

Quality checks

  • One primary metric, defined with numerator, denominator, window and counting rule.
  • The sample size calculation is shown with its inputs, or the calculator and inputs are named.
  • Run time is whole weeks, at least two, and the read date is written down.
  • Each guardrail has a numeric threshold.
  • The MDE is justified by value, not reverse-engineered from available traffic.
  • The plan says what happens for each outcome, including "no difference".
  • If the test can't finish within six weeks, the plan says so and offers alternatives.

Common mistakes

  • Peeking and stopping early. Checking daily and stopping at the first significant reading turns many "wins" into noise.
  • Testing with too little traffic. An underpowered test ends "no difference" and the team concludes the idea failed.
  • Too many metrics. With ten metrics, one will look significant by chance; pick one primary.
  • Partial weeks. Weekday and weekend visitors behave differently; run whole weeks.
  • Splitting by session. The same person sees both versions and contaminates both arms.
  • Changing the test mid-flight. Editing a variant or the split restarts the clock; treat it as a new test.

Reference files

The skill loads these when it needs them. They install with it.

Run these skills on live data in Slate

Slate brings keyword data, Search Console, GA4 and how ChatGPT, Perplexity and Google AI answer about your brand into one workspace, so every skill runs on real numbers.