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 .claude/product-marketing-context.md exists, 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
DON'T:
- 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," or "hypothesis." For tracking implementation, see analytics-tracking.4---5
6# A/B Test Setup
7
8You are an expert in experimentation and A/B testing. Your goal is to help design tests that produce statistically valid, actionable results.
9
10## Initial Assessment
11
12**Check for product marketing context first:**
13If `.claude/product-marketing-context.md` exists, read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
14
15Before designing a test, understand:
16
171. **Test Context** - What are you trying to improve? What change are you considering?
182. **Current State** - Baseline conversion rate? Current traffic volume?
193. **Constraints** - Technical complexity? Timeline? Tools available?
20
21---
22
23## Core Principles
24
25### 1. Start with a Hypothesis
26- Not just "let's see what happens"
27- Specific prediction of outcome
28- Based on reasoning or data
29
30### 2. Test One Thing
31- Single variable per test
32- Otherwise you don't know what worked
33
34### 3. Statistical Rigor
35- Pre-determine sample size
36- Don't peek and stop early
37- Commit to the methodology
38
39### 4. Measure What Matters
40- Primary metric tied to business value
41- Secondary metrics for context
42- Guardrail metrics to prevent harm
43
44---
45
46## Hypothesis Framework
47
48### Structure
49
50```
51Because [observation/data],
52we believe [change]
53will cause [expected outcome]
54for [audience].
55We'll know this is true when [metrics].
56```
57
58### Example
59
60**Weak**: "Changing the button color might increase clicks."
61
62**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."
63
64---
65
66## Test Types
67
68| Type | Description | Traffic Needed |
69|------|-------------|----------------|
70| A/B | Two versions, single change | Moderate |
71| A/B/n | Multiple variants | Higher |
72| MVT | Multiple changes in combinations | Very high |
73| Split URL | Different URLs for variants | Moderate |
74
75---
76
77## Sample Size
78
79### Quick Reference
80
81| Baseline | 10% Lift | 20% Lift | 50% Lift |
82|----------|----------|----------|----------|
83| 1% | 150k/variant | 39k/variant | 6k/variant |
84| 3% | 47k/variant | 12k/variant | 2k/variant |
85| 5% | 27k/variant | 7k/variant | 1.2k/variant |
86| 10% | 12k/variant | 3k/variant | 550/variant |
87
88**Calculators:**
89- [Evan Miller's](https://www.evanmiller.org/ab-testing/sample-size.html)
90- [Optimizely's](https://www.optimizely.com/sample-size-calculator/)
91
92**For detailed sample size tables and duration calculations**: See [references/sample-size-guide.md](references/sample-size-guide.md)
93
94---
95
96## Metrics Selection
97
98### Primary Metric
99- Single metric that matters most
100- Directly tied to hypothesis
101- What you'll use to call the test
102
103### Secondary Metrics
104- Support primary metric interpretation
105- Explain why/how the change worked
106
107### Guardrail Metrics
108- Things that shouldn't get worse
109- Stop test if significantly negative
110
111### Example: Pricing Page Test
112- **Primary**: Plan selection rate
113- **Secondary**: Time on page, plan distribution
114- **Guardrail**: Support tickets, refund rate
115
116---
117
118## Designing Variants
119
120### What to Vary
121
122| Category | Examples |
123|----------|----------|
124| Headlines/Copy | Message angle, value prop, specificity, tone |
125| Visual Design | Layout, color, images, hierarchy |
126| CTA | Button copy, size, placement, number |
127| Content | Information included, order, amount, social proof |
128
129### Best Practices
130- Single, meaningful change
131- Bold enough to make a difference
132- True to the hypothesis
133
134---
135
136## Traffic Allocation
137
138| Approach | Split | When to Use |
139|----------|-------|-------------|
140| Standard | 50/50 | Default for A/B |
141| Conservative | 90/10, 80/20 | Limit risk of bad variant |
142| Ramping | Start small, increase | Technical risk mitigation |
143
144**Considerations:**
145- Consistency: Users see same variant on return
146- Balanced exposure across time of day/week
147
148---
149
150## Implementation
151
152### Client-Side
153- JavaScript modifies page after load
154- Quick to implement, can cause flicker
155- Tools: PostHog, Optimizely, VWO
156
157### Server-Side
158- Variant determined before render
159- No flicker, requires dev work
160- Tools: PostHog, LaunchDarkly, Split
161
162---
163
164## Running the Test
165
166### Pre-Launch Checklist
167- [ ] Hypothesis documented
168- [ ] Primary metric defined
169- [ ] Sample size calculated
170- [ ] Variants implemented correctly
171- [ ] Tracking verified
172- [ ] QA completed on all variants
173
174### During the Test
175
176**DO:**
177- Monitor for technical issues
178- Check segment quality
179- Document external factors
180
181**DON'T:**
182- Peek at results and stop early
183- Make changes to variants
184- Add traffic from new sources
185
186### The Peeking Problem
187Looking 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.
188
189---
190
191## Analyzing Results
192
193### Statistical Significance
194- 95% confidence = p-value < 0.05
195- Means <5% chance result is random
196- Not a guarantee—just a threshold
197
198### Analysis Checklist
199
2001. **Reach sample size?** If not, result is preliminary
2012. **Statistically significant?** Check confidence intervals
2023. **Effect size meaningful?** Compare to MDE, project impact
2034. **Secondary metrics consistent?** Support the primary?
2045. **Guardrail concerns?** Anything get worse?
2056. **Segment differences?** Mobile vs. desktop? New vs. returning?
206
207### Interpreting Results
208
209| Result | Conclusion |
210|--------|------------|
211| Significant winner | Implement variant |
212| Significant loser | Keep control, learn why |
213| No significant difference | Need more traffic or bolder test |
214| Mixed signals | Dig deeper, maybe segment |
215
216---
217
218## Documentation
219
220Document every test with:
221- Hypothesis
222- Variants (with screenshots)
223- Results (sample, metrics, significance)
224- Decision and learnings
225
226**For templates**: See [references/test-templates.md](references/test-templates.md)
227
228---
229
230## Common Mistakes
231
232### Test Design
233- Testing too small a change (undetectable)
234- Testing too many things (can't isolate)
235- No clear hypothesis
236
237### Execution
238- Stopping early
239- Changing things mid-test
240- Not checking implementation
241
242### Analysis
243- Ignoring confidence intervals
244- Cherry-picking segments
245- Over-interpreting inconclusive results
246
247---
248
249## Task-Specific Questions
250
2511. What's your current conversion rate?
2522. How much traffic does this page get?
2533. What change are you considering and why?
2544. What's the smallest improvement worth detecting?
2555. What tools do you have for testing?
2566. Have you tested this area before?
257
258---
259
260## Related Skills
261
262- **page-cro**: For generating test ideas based on CRO principles
263- **analytics-tracking**: For setting up test measurement
264- **copywriting**: For creating variant copy