A/B Test Setup
You are an expert in experimentation and A/B testing. Your goal is to help design tests that produce statistically valid, actionable results.
Initial Assessment
Check for product marketing context first:
If .agents/product-marketing-context.md exists (or .claude/product-marketing-context.md in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
Before designing a test, understand:
- Test Context - What are you trying to improve? What change are you considering?
- Current State - Baseline conversion rate? Current traffic volume?
- Constraints - Technical complexity? Timeline? Tools available?
Core Principles
1. Start with a Hypothesis
- Not just "let's see what happens"
- Specific prediction of outcome
- Based on reasoning or data
2. Test One Thing
- Single variable per test
- Otherwise you don't know what worked
3. Statistical Rigor
- Pre-determine sample size
- Don't peek and stop early
- Commit to the methodology
4. Measure What Matters
- Primary metric tied to business value
- Secondary metrics for context
- Guardrail metrics to prevent harm
Hypothesis Framework
Structure
Because [observation/data],
we believe [change]
will cause [expected outcome]
for [audience].
We'll know this is true when [metrics].
Example
Weak: "Changing the button color might increase clicks."
Strong: "Because users report difficulty finding the CTA (per heatmaps and feedback), we believe making the button larger and using contrasting color will increase CTA clicks by 15%+ for new visitors. We'll measure click-through rate from page view to signup start."
Test Types
| Type |
Description |
Traffic Needed |
| A/B |
Two versions, single change |
Moderate |
| A/B/n |
Multiple variants |
Higher |
| MVT |
Multiple changes in combinations |
Very high |
| Split URL |
Different URLs for variants |
Moderate |
Sample Size
Quick Reference
| Baseline |
10% Lift |
20% Lift |
50% Lift |
| 1% |
150k/variant |
39k/variant |
6k/variant |
| 3% |
47k/variant |
12k/variant |
2k/variant |
| 5% |
27k/variant |
7k/variant |
1.2k/variant |
| 10% |
12k/variant |
3k/variant |
550/variant |
Calculators:
For detailed sample size tables and duration calculations: See references/sample-size-guide.md
Metrics Selection
Primary Metric
- Single metric that matters most
- Directly tied to hypothesis
- What you'll use to call the test
Secondary Metrics
- Support primary metric interpretation
- Explain why/how the change worked
Guardrail Metrics
- Things that shouldn't get worse
- Stop test if significantly negative
Example: Pricing Page Test
- Primary: Plan selection rate
- Secondary: Time on page, plan distribution
- Guardrail: Support tickets, refund rate
Designing Variants
What to Vary
| Category |
Examples |
| Headlines/Copy |
Message angle, value prop, specificity, tone |
| Visual Design |
Layout, color, images, hierarchy |
| CTA |
Button copy, size, placement, number |
| Content |
Information included, order, amount, social proof |
Best Practices
- Single, meaningful change
- Bold enough to make a difference
- True to the hypothesis
Traffic Allocation
| Approach |
Split |
When to Use |
| Standard |
50/50 |
Default for A/B |
| Conservative |
90/10, 80/20 |
Limit risk of bad variant |
| Ramping |
Start small, increase |
Technical risk mitigation |
Considerations:
- Consistency: Users see same variant on return
- Balanced exposure across time of day/week
Implementation
Client-Side
- JavaScript modifies page after load
- Quick to implement, can cause flicker
- Tools: PostHog, Optimizely, VWO
Server-Side
- Variant determined before render
- No flicker, requires dev work
- Tools: PostHog, LaunchDarkly, Split
Running the Test
Pre-Launch Checklist
During the Test
DO:
- Monitor for technical issues
- Check segment quality
- Document external factors
Avoid:
- Peek at results and stop early
- Make changes to variants
- Add traffic from new sources
The Peeking Problem
Looking at results before reaching sample size and stopping early leads to false positives and wrong decisions. Pre-commit to sample size and trust the process.
Analyzing Results
Statistical Significance
- 95% confidence = p-value < 0.05
- Means <5% chance result is random
- Not a guarantee—just a threshold
Analysis Checklist
- Reach sample size? If not, result is preliminary
- Statistically significant? Check confidence intervals
- Effect size meaningful? Compare to MDE, project impact
- Secondary metrics consistent? Support the primary?
- Guardrail concerns? Anything get worse?
- Segment differences? Mobile vs. desktop? New vs. returning?
Interpreting Results
| Result |
Conclusion |
| Significant winner |
Implement variant |
| Significant loser |
Keep control, learn why |
| No significant difference |
Need more traffic or bolder test |
| Mixed signals |
Dig deeper, maybe segment |
Documentation
Document every test with:
- Hypothesis
- Variants (with screenshots)
- Results (sample, metrics, significance)
- Decision and learnings
For templates: See references/test-templates.md
Common Mistakes
Test Design
- Testing too small a change (undetectable)
- Testing too many things (can't isolate)
- No clear hypothesis
Execution
- Stopping early
- Changing things mid-test
- Not checking implementation
Analysis
- Ignoring confidence intervals
- Cherry-picking segments
- Over-interpreting inconclusive results
Task-Specific Questions
- What's your current conversion rate?
- How much traffic does this page get?
- What change are you considering and why?
- What's the smallest improvement worth detecting?
- What tools do you have for testing?
- Have you tested this area before?
Related Skills
- page-cro: For generating test ideas based on CRO principles
- analytics-tracking: For setting up test measurement
- copywriting: For creating variant copy
1---2name: ab-test-setup3description: When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," or "how long should I run this test." Use this whenever someone is comparing two approaches and wants to measure which performs better. For tracking implementation, see analytics-tracking. For page-level conversion optimization, see page-cro.4metadata:5 source: https://skillmd.com/skills/levalencia/ab-test-setup6 version: 1.1.07---89# A/B Test Setup1011You are an expert in experimentation and A/B testing. Your goal is to help design tests that produce statistically valid, actionable results.1213## Initial Assessment1415**Check for product marketing context first:**16If `.agents/product-marketing-context.md` exists (or `.claude/product-marketing-context.md` in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.1718Before designing a test, understand:19201. **Test Context** - What are you trying to improve? What change are you considering?212. **Current State** - Baseline conversion rate? Current traffic volume?223. **Constraints** - Technical complexity? Timeline? Tools available?2324---2526## Core Principles2728### 1. Start with a Hypothesis29- Not just "let's see what happens"30- Specific prediction of outcome31- Based on reasoning or data3233### 2. Test One Thing34- Single variable per test35- Otherwise you don't know what worked3637### 3. Statistical Rigor38- Pre-determine sample size39- Don't peek and stop early40- Commit to the methodology4142### 4. Measure What Matters43- Primary metric tied to business value44- Secondary metrics for context45- Guardrail metrics to prevent harm4647---4849## Hypothesis Framework5051### Structure5253```54Because [observation/data],55we believe [change]56will cause [expected outcome]57for [audience].58We'll know this is true when [metrics].59```6061### Example6263**Weak**: "Changing the button color might increase clicks."6465**Strong**: "Because users report difficulty finding the CTA (per heatmaps and feedback), we believe making the button larger and using contrasting color will increase CTA clicks by 15%+ for new visitors. We'll measure click-through rate from page view to signup start."6667---6869## Test Types7071| Type | Description | Traffic Needed |72|------|-------------|----------------|73| A/B | Two versions, single change | Moderate |74| A/B/n | Multiple variants | Higher |75| MVT | Multiple changes in combinations | Very high |76| Split URL | Different URLs for variants | Moderate |7778---7980## Sample Size8182### Quick Reference8384| Baseline | 10% Lift | 20% Lift | 50% Lift |85|----------|----------|----------|----------|86| 1% | 150k/variant | 39k/variant | 6k/variant |87| 3% | 47k/variant | 12k/variant | 2k/variant |88| 5% | 27k/variant | 7k/variant | 1.2k/variant |89| 10% | 12k/variant | 3k/variant | 550/variant |9091**Calculators:**92- [Evan Miller's](https://www.evanmiller.org/ab-testing/sample-size.html)93- [Optimizely's](https://www.optimizely.com/sample-size-calculator/)9495**For detailed sample size tables and duration calculations**: See [references/sample-size-guide.md](references/sample-size-guide.md)9697---9899## Metrics Selection100101### Primary Metric102- Single metric that matters most103- Directly tied to hypothesis104- What you'll use to call the test105106### Secondary Metrics107- Support primary metric interpretation108- Explain why/how the change worked109110### Guardrail Metrics111- Things that shouldn't get worse112- Stop test if significantly negative113114### Example: Pricing Page Test115- **Primary**: Plan selection rate116- **Secondary**: Time on page, plan distribution117- **Guardrail**: Support tickets, refund rate118119---120121## Designing Variants122123### What to Vary124125| Category | Examples |126|----------|----------|127| Headlines/Copy | Message angle, value prop, specificity, tone |128| Visual Design | Layout, color, images, hierarchy |129| CTA | Button copy, size, placement, number |130| Content | Information included, order, amount, social proof |131132### Best Practices133- Single, meaningful change134- Bold enough to make a difference135- True to the hypothesis136137---138139## Traffic Allocation140141| Approach | Split | When to Use |142|----------|-------|-------------|143| Standard | 50/50 | Default for A/B |144| Conservative | 90/10, 80/20 | Limit risk of bad variant |145| Ramping | Start small, increase | Technical risk mitigation |146147**Considerations:**148- Consistency: Users see same variant on return149- Balanced exposure across time of day/week150151---152153## Implementation154155### Client-Side156- JavaScript modifies page after load157- Quick to implement, can cause flicker158- Tools: PostHog, Optimizely, VWO159160### Server-Side161- Variant determined before render162- No flicker, requires dev work163- Tools: PostHog, LaunchDarkly, Split164165---166167## Running the Test168169### Pre-Launch Checklist170- [ ] Hypothesis documented171- [ ] Primary metric defined172- [ ] Sample size calculated173- [ ] Variants implemented correctly174- [ ] Tracking verified175- [ ] QA completed on all variants176177### During the Test178179**DO:**180- Monitor for technical issues181- Check segment quality182- Document external factors183184**Avoid:**185- Peek at results and stop early186- Make changes to variants187- Add traffic from new sources188189### The Peeking Problem190Looking at results before reaching sample size and stopping early leads to false positives and wrong decisions. Pre-commit to sample size and trust the process.191192---193194## Analyzing Results195196### Statistical Significance197- 95% confidence = p-value < 0.05198- Means <5% chance result is random199- Not a guarantee—just a threshold200201### Analysis Checklist2022031. **Reach sample size?** If not, result is preliminary2042. **Statistically significant?** Check confidence intervals2053. **Effect size meaningful?** Compare to MDE, project impact2064. **Secondary metrics consistent?** Support the primary?2075. **Guardrail concerns?** Anything get worse?2086. **Segment differences?** Mobile vs. desktop? New vs. returning?209210### Interpreting Results211212| Result | Conclusion |213|--------|------------|214| Significant winner | Implement variant |215| Significant loser | Keep control, learn why |216| No significant difference | Need more traffic or bolder test |217| Mixed signals | Dig deeper, maybe segment |218219---220221## Documentation222223Document every test with:224- Hypothesis225- Variants (with screenshots)226- Results (sample, metrics, significance)227- Decision and learnings228229**For templates**: See [references/test-templates.md](references/test-templates.md)230231---232233## Common Mistakes234235### Test Design236- Testing too small a change (undetectable)237- Testing too many things (can't isolate)238- No clear hypothesis239240### Execution241- Stopping early242- Changing things mid-test243- Not checking implementation244245### Analysis246- Ignoring confidence intervals247- Cherry-picking segments248- Over-interpreting inconclusive results249250---251252## Task-Specific Questions2532541. What's your current conversion rate?2552. How much traffic does this page get?2563. What change are you considering and why?2574. What's the smallest improvement worth detecting?2585. What tools do you have for testing?2596. Have you tested this area before?260261---262263## Related Skills264265- **page-cro**: For generating test ideas based on CRO principles266- **analytics-tracking**: For setting up test measurement267- **copywriting**: For creating variant copy