/marketing-skills:ab-test-setupfrom marketing-skills
Calculates A/B test sample size and duration, generates reviewable test plans, and analyzes conversion results with z-tests, confidence intervals, and sample ratio checks. Provides ship/revert/inconclusive verdicts.
Ships in marketing-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Production-ready A/B testing toolkit for calculating sample sizes, designing rigorous test plans, and analyzing results with statistical significance testing. Designed for growth teams, product managers, and marketers who need to make data-driven decisions from controlled experiments.
Before designing the test, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
python3 scripts/sample_size_calculator.py --baseline 0.05 --mde 0.10 --daily-traffic 1000
python3 scripts/test_designer.py assets/sample_config.json
python3 scripts/results_analyzer.py assets/flawed_results.json
Real output (excerpt) of the last command:
Difference: +0.139 pp (+3.08% relative)
z = 0.511, p = 0.6093 (alpha 0.05), 95% CI [-0.394, +0.672] pp, Cohen's h 0.007
Verdict: INVALID (sample ratio mismatch)
- sample ratio mismatch, p < 0.001 (allocation from input): `control=12500, treatment=11200, expected 11850 / 11850 (chi2 p=3.1e-17)`. Fix: Do not trust this result. Audit assignment, bot filtering and redirects, then re-run
FIX 1 of 1 test(s) need action
Every finding quotes the offending input and gives a fix. All tools accept --format text|json (--json is an alias).
| Code | Meaning |
|---|---|
| 0 | sample_size_calculator: plan fits --max-days (or no traffic given). test_designer: no gaps. results_analyzer: every test is a significant win with a healthy split |
| 1 | Findings to act on: plan too long, config gaps, loss, inconclusive result, sample ratio mismatch, thin data |
| 2 | Unusable input (bad flag value, empty or non-JSON file, missing field, conversions greater than visitors). One BLOCKED: line, no traceback |
| Tool | Purpose | Input |
|---|---|---|
sample_size_calculator.py | Visitors per arm and days needed | --baseline, --mde (relative lift), optional --daily-traffic, --variants, --max-days |
test_designer.py | Test plan with decision rule, timeline, checklist | JSON config (required fields below) |
results_analyzer.py | Z-test, CI, Cohen's h, sample ratio mismatch check, verdict | JSON counts; --batch for many tests; --bayesian adds a seeded Beta-Binomial comparison |
abstats.py | Shared helper module (not a command) |
Notes on behaviour: with more than 2 variants the sample size uses a Bonferroni alpha (alpha / (variants - 1)). The 14-day floor, 30-day and 56-day length limits, 3-secondary-metric limit and the 1% low-baseline flag are internal heuristics, labelled as such in the output. The sample-ratio alarm (p < 0.001) is a common platform convention. test_designer never invents defaults: missing required fields exit 2, and a missing daily_traffic, hypothesis or guardrail list is reported as a gap.
python3 scripts/sample_size_calculator.py --baseline <rate> --mde <lift> --daily-traffic <n>; if it exits 1, apply the suggested MDE or add traffic.assets/sample_config.json) and run python3 scripts/test_designer.py <config>; close every gap until it prints PASS.assets/sample_results.json); include allocation so the split check uses your real design.python3 scripts/results_analyzer.py <file> --bayesianpython3 scripts/results_analyzer.py assets/sample_batch.json --batch reports ship / revert / inconclusive / invalid counts across tests.
references/ab-testing-guide.md: statistical foundations, sample size theory, pitfalls, sequential and Bayesian approaches.
Config (test_designer.py; required: test_name, hypothesis, metric_primary, baseline_rate, minimum_detectable_effect, variants; daily_traffic means eligible visitors per day, all arms combined):
{"test_name": "Homepage CTA colour", "hypothesis": "... will increase cta_click_rate because ...",
"metric_primary": "cta_click_rate", "baseline_rate": 0.045, "minimum_detectable_effect": 0.15,
"daily_traffic": 5000, "variants": [{"name": "control", "description": "Blue"}, {"name": "treatment", "description": "Green"}],
"guardrail_metrics": [{"metric": "bounce_rate", "threshold": "no more than +5% relative"}]}
Results (results_analyzer.py; exactly two arms named control and treatment, or a list of two):
{"test_name": "Homepage CTA colour", "allocation": {"control": 0.5, "treatment": 0.5},
"variants": {"control": {"visitors": 12500, "conversions": 563}, "treatment": {"visitors": 12480, "conversions": 702}}}
In Scope:
sample_size_calculator.py, using the two-proportion z-test formula with configurable alpha, power, one- or two-sided testing, allocation and variant counttest_designer.pyresults_analyzer.py: two-proportion z-test, p-value, confidence interval and Cohen's h effect size, with optional Bayesian analysis and batch mode for reviewing several testsOut of Scope:
marketing/analytics-tracking/)data-analytics/statistical-analyst/)business-growth/page-cro/ and business-growth/form-cro/)Important Caveats:
examples/test_results.csv is a raw-log example only; the tools do not read CSV.results_analyzer.py compares two variants (control and treatment). It exits 2 for A/B/n input; analyze arms pairwise in separate files. sample_size_calculator.py applies a Bonferroni alpha for more than 2 variants.results_analyzer.py checks sample ratio mismatch; segment effects, novelty effects and peeking are not checked (see the reference guide).assets/contract.json (opens in a new tab)assets/flawed_config.json (opens in a new tab)assets/flawed_results.json (opens in a new tab)assets/malformed_config.json (opens in a new tab)assets/malformed_results.json (opens in a new tab)assets/sample_batch.json (opens in a new tab)assets/sample_config.json (opens in a new tab)assets/sample_results.json (opens in a new tab)examples/test_results.csv (opens in a new tab)references/ab-testing-guide.md (opens in a new tab)scripts/abstats.py (opens in a new tab)scripts/results_analyzer.py (opens in a new tab)scripts/sample_size_calculator.py (opens in a new tab)scripts/test_designer.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ab-testing, experimentation, statistics, sample-size, conversion-rate
46 skills in this plugin
/ad-creativeDesign ad creative across Google, Meta, LinkedIn, Twitter/X, and TikTok with platform format specs, headline formulas, and A/B testing. Use when writing ad copy, generating headline variations, creating ad sets, or validating creative.
/aeoAnswer Engine Optimization (AEO): checks a page for the structures LLM answers quote (definition first, tables, numbered steps, sourced numbers, question headings, visible date), generates FAQ/HowTo JSON-LD from the page's own Q&A, and tallies brand mentions and cited URLs in saved LLM answers. Use when auditing a page for LLM citability, adding Q&A schema, or measuring whether ChatGPT, Claude, Perplexity or Gemini name your brand.
/ai-content-disclosurenpx claudepluginhub borghei/claude-skills --plugin marketing-skillsOther plugins' skills for the same job