analytics-diagnostic-m…
The spine of analytics investigation. Use whenever interpreting analytics numbers, answering "why did X change", reading funnels, comparing cohorts, or…
Always-valid sequential inference for honest peeking at running A/B tests. Applies mSPRT (mixture Sequential Probability Ratio Test) or confidence sequences so the false-positive rate stays at the nominal alpha even when the test is checked daily. Use this skill when the user
$ npx -y skills add clamp-sh/analytics-skills --skill sequential-monitoring --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sequential-monitoringContext preview
The summary Claude sees to decide when to auto-load this skill.
Always-valid sequential inference for honest peeking at running A/B tests. Applies mSPRT (mixture Sequential Probability Ratio Test) or confidence sequences so the false-positive rate stays at the nominal alpha even when the test is checked daily. Use this skill when the user
name: sequential-monitoring description: Always-valid sequential inference for honest peeking at running A/B tests. Applies mSPRT (mixture Sequential Probability Ratio Test) or confidence sequences so the false-positive rate stays at the nominal alpha even when the test is checked daily. Use this skill when the user asks if it's safe to call an A/B test early, or to peek-check a running test. Pairs with experiment-result-reader and bayesian-experiment-reader, and with analytics-diagnostic-method for the framing discipline. Triggers when Clamp MCP returns mid-experiment exposure and conversion counts, or when a user references peeking, early stopping, sequential testing, alpha-spending, mSPRT, or confidence sequences. Vendor-neutral methodology; works with any analytics source, with Clamp MCP as the canonical integration. Use whenever interpreting an in-flight experiment where the planned horizon has not been reached but the user wants a stop/continue decision. when_to_use: When the user asks "can we stop the test now?", "the variant looks like it's winning, is it safe to ship?", "I've been peeking, did I break the test?", "what's the sequential p-value here?", or "how do I check a running test without inflating false positives?". Also when an agent is mid-loop on a running experiment and needs to decide whether to call it.
A fixed-horizon A/B test promises a 5% false-positive rate at one planned read. The moment you check the result daily and stop "when it looks good", the actual false-positive rate climbs to 20-30%. Sequential testing fixes this: it lets you check as often as you like and stop the moment the evidence is strong enough, with the type-I error still controlled at the nominal alpha. This skill encodes when to apply mSPRT versus confidence sequences, how to read the boundaries, and when sequential math will not rescue an underpowered test.
A fixed-horizon test computes a p-value under the assumption you look once, at the planned end. Each additional peek is another chance to cross the 5% threshold by noise alone.
| Peeks across the test | Actual false-positive rate (nominal 5%) | |---|---| | 1 (end only) | 5% | | 2 | ~8% | | 5 (weekly) | ~14% | | 10 (twice weekly) | ~19% | | Daily over a month | ~25-30% |
If the user has been "checking how the test is doing" every morning, the nominal 5% threshold is meaningless. They need either a sequential method (always-valid) or alpha-spending (pre-commit to a peek schedule and inflate the threshold).
Two practical options. Pick by the decision the user is actually making.
| Question the user is asking | Use | Output | |---|---|---| | "Should we ship treatment or not?" (binary call) | **mSPRT** | Log-likelihood ratio crosses upper or lower boundary → ship or reject | | "What is the lift, with a CI I can trust at any time?" | **Confidence sequences** | Always-valid CI on lift; ship when the CI excludes 0 (or excludes a minimum effect) | | "I just want to peek without breaking alpha" | Either; mSPRT is simpler to read | See above |
Both methods are always-valid: the false-positive rate stays at alpha no matter how often you look. mSPRT is Statsig's default; confidence sequences are GrowthBook's default. The choice is taste plus what the user wants to read.
Same prerequisites as `experiment-result-reader`:
1. The experiment is declared (variants, intent, exposure event firing reliably). 2. Per-variant exposure counts are roughly balanced (no sample ratio mismatch). SRM contaminates sequential reads just as badly as fixed-horizon ones. 3. The conversion event is attributable to the exposure session (or windowed appropriately). 4. The smaller arm has n ≥ 400. Below that, sequential math is honest but uninformative.
If any check fails, stop and surface the issue.
mSPRT (Johari et al., 2017) generalises Wald's 1945 SPRT to the case where the effect size is unknown. The trick: instead of testing a single point alternative (e.g. "lift = 2pp exactly"), test a *mixture* over plausible alternatives, weighted by a prior. This gives a single log-likelihood ratio statistic that can be checked at every observation.
For a two-proportion test (conversion rate, control vs treatment):
1. **Define alpha and the mixture variance.** Standard choice: alpha = 0.05, mixture variance tau² ≈ MDE² (e.g. if you cared about detecting a 1pp lift, tau ≈ 0.01). 2. **Compute the running log-likelihood ratio.** At each new observation:
logLR(n) = log( (1 / sqrt(1 + n·V/tau²)) ·
exp( (n·V·(diff)²) / (2·(tau² + n·V)) ) )where `n` is the per-arm sample size, `V` is the pooled variance of the proportion, and `diff` is the observed control-treatment difference. 3. **Boundaries.** Upper boundary = log(1/alpha) ≈ 3.00 for alpha = 0.05. Lower boundary is symmetric (log(alpha)) for two-sided rejection, or use 0 if you only stop for "treatment wins". 4. **Stopping rule.** If logLR > upper boundary → reject H0, s
Analytics skills for Claude, Cursor, and other AI agents. Read web analytics like a senior analyst: diagnose traffic changes, judge channel quality, read funnels, declare typed events, and read A/B tests without the usual rookie mistakes.
Repo: clamp-sh/analytics-skills
The spine of analytics investigation. Use whenever interpreting analytics numbers, answering "why did X change", reading funnels, comparing cohorts, or…
One-time interview that captures the business context (industry, model, primary conversion, traffic range, ICP, data stack) into a local analytics-profile.md…
Formal time-series methods that augment the hand-coded fingerprint library in traffic-change-diagnosis. Use this skill when traffic-change-diagnosis…
Bayesian counterpart to experiment-result-reader. Computes posterior P(variant beats control), credible intervals, and expected loss from per-variant exposure…
Build a refinable causal DAG before answering "did X cause Y" on observational data. Emits a Mermaid diagram of assumed causes, applies the back-door criterion…
Bradford Hill's 9 viewpoints (1965) reframed as a checklist for product analytics. Use this skill before recommending a decision based on observational…