Skip to content

ab-testing

Use when designing, implementing, monitoring, or analyzing A/B tests. Also use when calculating sample sizes, setting up PostHog experiments, checking statistical significance, or documenting experiment results.

ModelSource
sonnetpack: cro
Full Reference

Full experiment lifecycle for service businesses: hypothesis → sample size → implementation → monitoring → analysis → documentation. Built around PostHog experiments with awareness that lower traffic means larger MDE requirements.

ItemValue
Significance threshold95% (p < 0.05) — early stop only at 99.5%
Statistical power80% (Zβ = 0.84)
Max variants2 (control + test)
SRM tolerance±5% of 50/50 split — stop if exceeded
PostHog flag typeBoolean, 50/50 multivariate
PostHog SDK (client)posthog-js/reactusePostHog() hook
PostHog SDK (server)posthog-nodePostHog class
Goal event trackingposthog.capture() with $feature_flag + $feature_flag_response
Experiment archive location.claude/progress/experiments/
I want to…File
Calculate sample size, understand MDE lookup table, write a hypothesisreference/hypothesis-and-sample-size.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.


┏━ 🧪 ab-testing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Full A/B test lifecycle — hypothesis, sample size, PostHog, and analysis ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛