19-ab-test-setup-global
# Claude Code Skill: A/B Test Setup (Global) This skill guides users through designing statistically valid A/B tests for marketing experiments by establishing clear hypotheses, calculating required sample sizes, and determining statistical significance thresholds. Use it when planning split tests, multivariate experiments, or any campaign variant comparison where you need to distinguish real improvements from noise rather than making decisions on weak or rushed data.
git clone --depth 1 https://github.com/minhnv0807/ai-business-skills /tmp/19-ab-test-setup-global && cp -r /tmp/19-ab-test-setup-global/skills/en/19-ab-test-setup-global ~/.claude/skills/19-ab-test-setup-globalSKILL.md
# A/B Test Setup (Global)
> Run experiments that produce decisions, not noise. Most "A/B tests" in marketing are underpowered, peeked-at, and badly hypothesized — meaning the team learns nothing and ships the louder variant.
---
## For Newbies
A valid A/B test answers one question: "Did this change cause a real improvement, or am I seeing noise?"
To answer it credibly you need four things:
1. A **specific hypothesis** with a numeric prediction
2. **One variable changed** (everything else identical)
3. **Enough sample** to detect the effect you care about
4. **Statistical significance** before you call a winner (typically p < 0.05)
If any one of these is missing, you don't have an A/B test — you have a coin flip with extra steps.
**Common newbie mistake:** running a test for 3 days, seeing variant B 40% higher, declaring victory, and shipping. Three days is too short to absorb day-of-week effects, and small samples produce wild swings. Variant B may revert (or reverse) by day 14.
---
## Step 0 — Read Context
Read `.agents/product-marketing-context.md` if it exists. Audience size, average traffic, and current conversion rate determine whether a test is even feasible.
---
## Step 1 — Information Gathering
Ask up to 4 questions:
1. **What are you testing?** (Ad headline / Landing page section / Email subject / Pricing display / CTA button / Creative video)
2. **Primary metric?** (CTR / Conversion rate / CPM / CPA / Revenue / Open rate / Reply rate)
3. **Daily traffic to the test surface?** (Needed for sample size and duration)
4. **Goal of the test?** (Lift X% on primary metric / Pick a winner among N candidates / Validate a strategic hypothesis)
---
## The 7 Principles of a Valid A/B Test
### 1. Test exactly one variable
The cardinal rule. Change two things at once and you cannot attribute the result.
- **Bad:** "I changed the headline, the hero image, and the CTA color." → You learn nothing about which element drove the lift.
- **Good:** Change only the headline. Image, CTA, layout, traffic source, and audience targeting are identical.
If you must test multiple changes, use a **multivariate test (MVT)** — but those need much more traffic (often 4×–8× a single A/B).
### 2. Hypothesize with a number
**Format:** "If we [change X], [metric Y] will increase by [Z%] because [reason]."
- **Good:** "If we change the CTA from 'Sign up' to 'Get my free demo,' conversion rate will increase by 15% because action-specific language reduces ambiguity."
- **Bad:** "The new copy will be better." (No metric, no number, no causal reasoning — un-testable.)
The "because" matters: if your hypothesis is wrong but the reasoning was sound, you've still learned something generalizable.
### 3. Sufficient sample size
Don't stop early. Statistical tests need adequate data to distinguish signal from noise.
- **Minimum rule of thumb:** 100 conversions per variant (not 100 visitors)
- **Better:** Calculate sample size up front based on baseline conversion rate and minimum detectable effect (formula below)
### 4. Sufficient duration
Run for **whole weeks**, not 3 days, not 10 days. Different weekdays produce different audience behavior — Monday B2B traffic is not Saturday DTC traffic.
- **Minimum:** 7 days
- **Recommended:** 14 days
- **Watch for:** holidays, paydays, monthly billing cycles, ad spend ramp-ups
### 5. Don't peek
Looking at results every hour and stopping when "B looks good" is the most common error in marketing experimentation. Early peeks combined with early stops dramatically inflate false positive rates.
- Define the end date in advance. Honor it.
- If you must monitor, use **sequential testing** methods designed for it (Bayesian frameworks like Optimizely's Stats Engine, or platforms with built-in sequential controls).
### 6. Statistical significance: p < 0.05
Most marketing teams use **95% confidence (p-value < 0.05)** as the bar.
- p-value < 0.05 → less than 5% chance the observed difference is random
- p-value 0.05–0.10 → suggestive but inconclusive — extend the test
- p-value > 0.10 → no evidence of an effect — keep control or test something else
For high-stakes tests (pricing, branding) consider 99% confidence (p < 0.01).
### 7. Document everything
Write down:
- Hypothesis (with number)
- Start date / end date
- Sample size achieved
- Primary metric, secondary metrics
- Result + p-value
- Decision + reasoning
- What you'd test next
A documented test history prevents your team from re-testing things that already failed and from forgetting why you made past decisions.
---
## Sample Size Calculation
### Quick formula
```
Sample size per variant ≈ 16 × p × (1 − p) / MDE²
where:
p = baseline conversion rate (e.g. 0.03 = 3%)
MDE = minimum detectable effect, in absolute terms
(e.g. 0.006 = lift from 3% to 3.6%)
```
This produces sample size for **80% power, 95% confidence, 50/50 split** — sensible defaults for most marketing tests.
### Worked example A — landing page CRO
Current conversion rate is 3%. You want to detect a 20% relative lift (from 3% to 3.6%).
- p = 0.03
- MDE (absolute) = 0.20 × 0.03 = 0.006
- Sample size per variant = 16 × 0.03 × 0.97 / 0.006² = **12,933 visitors**
- Total: ~25,866 visitors. At 500 visitors/day → ~52 days.
That's slow. Either run it (if the change matters), test something with a bigger expected lift, or get more traffic on the test surface.
### Worked example B — email subject line
Current open rate is 25%. You want to detect a 10% relative lift (to 27.5%).
- p = 0.25
- MDE = 0.025
- Sample size per variant = 16 × 0.25 × 0.75 / 0.025² = **4,800 sends**
- Total: 9,600 sends per email — usually achievable in one campaign.
### Feasibility quick-reference
| Daily volume | Conv. rate | Days needed | Test feasibility |
|--------------|-----------|------------|------------------|
| < 100 | any | 2+ months | Skip — focus on traffic first |
| 100–500 | 2–5% | 3–6 weeks | Yes, but be paKe hoach Fullstack Marketing — master skill tong hop chien luoc, noi dung, trien khai, hieu suat, va timeline. Goi cac skill con de hoan thien output.
Use when the user needs an overall marketing plan for a period — objectives, segments, positioning, channel mix, content direction, budget, timeline, KPIs, and a risk matrix, adapted to US, EU, SEA, or LATAM. Trigger on 'marketing plan', 'marketing strategy for next year', 'go-to-market roadmap', 'plan for Q3', 'we have no marketing plan', 'where should we spend next quarter'. Also use when a founder only says the business needs to grow and has no idea which channel to start with. Not for — one specific campaign, see `02-campaign-brief-global`; working backward from a revenue goal to spend, see `10-reverse-kpi-global`; splitting a budget across channels and months, see `61-budget-planning-global`; taking a brand new product to market, see `59-go-to-market-global`.
Use when the user needs a monthly or weekly content calendar — posting schedule per channel, funnel ratio, content pillars, repurposing matrix, and an owner per slot. Trigger on 'content calendar', 'posting schedule', 'what should we post this month', 'editorial calendar', 'social media plan', 'we post randomly with no plan'. Also use when the user only says the team keeps running out of things to post. Not for — the brief for one specific post, see `36-content-brief-global`; the caption text itself, see `37-social-caption-global`; deciding next period content from last period data, see `40-next-content-plan-global`; a paid campaign timeline, see `02-campaign-brief-global`.
Lich noi dung thang — len lich dang bai da kenh voi ti le pheu, content pillar, repurposing matrix, va scoring tieu chi.
Brief chien dich marketing — 9 phan day du tu Context den Risk, bao gom creative direction, RACI, budget allocation theo phase, va auto-trigger cac skill lien quan.
Use when a specific campaign needs a brief the whole team can execute from — context, objective, audience, core message, creative direction, channels, deliverables, week-by-week timeline, approval gates, and risks. Trigger on 'campaign brief', 'creative brief', 'launch brief', 'brief the team on this campaign', 'we are running a promo next month', 'what is the plan for this campaign'. Also use when the user describes a promotion out loud and asks for something the team can actually run. Not for — the whole period plan, see `00-marketing-plan-global`; the list of design files needed, see `41-campaign-asset-list-global`; assigning work to one person, see `64-team-brief-global`; a new product launch sequence, see `59-go-to-market-global`.
Danh gia hieu suat marketing — audit performance ads va organic, chan doan root cause, de xuat toi uu voi action plan 48h va checklist hang tuan.
Use when marketing numbers look bad and the user needs to know WHY — layered root-cause diagnosis across tracking, delivery, creative, landing page, offer, and audience quality, 5-Whys, regional benchmarks for US, EU, SEA, and LATAM, and a 48-hour action plan. Covers dropshipping ROAS and BE-ROAS. Trigger on 'why is CPA so high', 'my ads are not converting', 'ROAS dropped', 'we are burning budget', 'performance is bad this month', 'diagnose the funnel'. Also use when the user pastes a screenshot of numbers with no question attached. Not for — auditing account configuration and scoring health, see `21-ads-audit-global`; writing a report someone else reads, see `07-marketing-report-global`; turning a raw export into insight, see `13-data-analysis-global`.