Antigravity ab test setup

From boisenoise/skills-collections · View interactive version

Antigravity ab test setup is an AI agent skill from the GitHub repository boisenoise/skills-collections. Use when designing an A/B or split test: define the hypothesis, control and variants, estimate sample size, verify tracking, and predeclare metrics and stopping rules.

How to use this skill

Skill file

A/B Test Setup

1️⃣ Purpose & Scope

Define an experiment that can answer a specific product question, and verify its assumptions before exposing users. This procedure cannot guarantee validity by itself.


2️⃣ Pre-Requisites

You must have:

Hypothesis Quality Checklist

A valid hypothesis includes:


3️⃣ Hypothesis Lock (Hard Gate)

Before designing variants or metrics, you MUST:

Use the hypothesis already agreed in the task. If a launch-critical choice is missing, present the concrete choice for confirmation while continuing independent analysis. Do not repeatedly request approval for a decision already authorized.


4️⃣ Assumptions & Validity Check (Mandatory)

Explicitly list assumptions about:

If assumptions are weak or violated:


5️⃣ Test Type Selection

Choose the simplest valid test:

Default to A/B unless there is a clear reason otherwise.


6️⃣ Metrics Definition

Primary Metric (Mandatory)
Secondary Metrics
Guardrail Metrics

7️⃣ Sample Size & Duration

Define upfront:

Estimate:

Do NOT proceed without a realistic sample size estimate.


Tracking Verification (Required before Gate 8)

Before entering the Execution Readiness Gate below, run through this checklist to make "Tracking is verified" mean something concrete:

  1. Event firing: Trigger each event the primary and secondary metrics depend on (sign-up, add-to-cart, custom event) on staging or a debug page, and confirm it arrives within that pipeline’s documented latency; record the observed delay.
  2. Variant attribution: Verify that the variant assignment ID is attached to every fired event — not just the entry event. Use your analytics' raw event view to compare a sample of 5+ events per variant.
  3. De-duplication: Confirm that a user reloading the page does not cause double-counted events. Use a stable event/transaction ID and document cross-client/server deduplication; a variant label alone is not a unique event key.
  4. Sample randomization: Check sample-ratio mismatch against the configured allocation with a pre-specified statistical check and adequate records. A fixed ±5% band on 100 records is not a valid universal randomization test. Inspect assignment stability, unit independence and missing exposure records.
  5. Guardrail metric pipeline: Each guardrail metric defined in §6️⃣ must have a working dashboard or alert by the time the test launches.

If any of the above fails, stop and resolve it before Gate 8.


8️⃣ Execution Readiness Gate (Hard Stop)

You may proceed to implementation only if all are true:

If any item is missing, stop and resolve it.


Running the Test

During the Test

DO:

DO NOT:


Analyzing Results

Analysis Discipline

When interpreting results:

Interpretation Outcomes

| Result | Action |

| -------------------- | -------------------------------------- |

| Significant positive | Consider rollout |

| Significant negative | Reject variant, document learning |

| Inconclusive | Report uncertainty; use the pre-specified continuation rule or design a new test |

| Guardrail failure | Do not ship, even if primary wins |


Documentation & Learning

Test Record (Mandatory)

Document:

Store records in a shared, searchable location to avoid repeated failures.


Refusal Conditions (Safety)

Refuse to proceed if:

Explain why and recommend next steps.


Key Principles (Non-Negotiable)


When to Use

Use when a product change has enough eligible traffic for a randomized comparison and a measurable outcome. For low-volume launches or qualitative discovery, consider usability research or descriptive measurement instead of claiming causal lift.

Sample-size calculation example

For an illustrative binary metric, estimate the per-variant sample for a change

from 10% to 11% (one percentage point, 10% relative lift), 50/50 allocation,

two-sided alpha 0.05 and power 0.80. This Python 3 large-sample approximation uses

Cohen's proportion effect size:

from math import asin, ceil, sqrt
from statistics import NormalDist

baseline, variant = 0.10, 0.11  # illustrative assumptions, not measured data
alpha, power = 0.05, 0.80
h = abs(2 * asin(sqrt(variant)) - 2 * asin(sqrt(baseline)))
z = NormalDist()
per_variant = ceil(2 * (z.inv_cdf(1 - alpha / 2) + z.inv_cdf(power)) ** 2 / h ** 2)
print(per_variant)

Expected output: 14745 observations per variant for these assumptions.

This calculation assumes independent units, one binary outcome, a fixed horizon

and no multiplicity adjustment. It is inappropriate for clustered or repeated

observations, sequential decisions or continuous revenue metrics. Account for

eligible traffic, attrition, outcome delay and the sampling unit before turning a

sample estimate into calendar duration. Equal assumed rates have zero effect size

and no finite sample for detecting that difference.

Worked example

Observation: users abandon a long signup form.
Change: remove one optional field; unit: account; allocation: 50/50 and stable.
Primary metric: completed signup / eligible assigned accounts within 24 hours.
Guardrails: validation failures and support requests.
Before launch: estimate sample needs from baseline and MDE, verify exposure and
completion IDs, define analysis window and stopping rule.
Expected report: counts, absolute/relative effect, interval, data-quality checks,
guardrail results and a decision with its limits; never just “p < 0.05, ship”.

Limitations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.