Guides agents through experiment creation: reading the project's setup with experiment-setup-context, defining the hypothesis, configuring rollout and bucketing, setting up analytics and running time, and reporting which choices are guesses. Delegates rollout decisions to configuring-experiment-rollout and metric setup to configuring-experiment-analytics. TRIGGER when: user asks to create a new experiment or A/B test, OR when you are about to call experiment-create. DO NOT TRIGGER when: user is updating an existing experiment, managing lifecycle, or only browsing experiments.
73
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
—
The risk profile of this skill
This skill walks through creating a new A/B test experiment: read the project, then the 3-step flow, then report the draft.
Create the experiment as a draft quickly, then iterate on metrics and configuration. The user gets a tangible draft immediately and can refine it. Choose settings from the project's facts rather than asking, and say which choices are guesses.
The right bucketing, metric and running time depend on the project: who sees the page, which SDKs evaluate the flag, how often the metric event happens. Read that before configuring anything.
$pageview plus a URL fragment for a page) and a candidate metric event.
Confirm both exist with read-data-schema. Don't ask the user for event names you can find.experiment-setup-context tool is available, call it once with target_event, target_url_contains (for a page) and metric_event.
If it is not available, continue without it and treat every choice below as a best guess. Never call a tool you can't see.Ask the user only when a choice is "not decided" and the user is in the conversation. If the user said they are away, or asked for a draft without questions, decide with the defaults and list the open points in the report.
Gather these before calling experiment-create:
description)experiment-create cannot set (see the recipe in configuring-experiment-rollout)."product". The "web" value is reserved for no-code experiments configured visually with the PostHog
toolbar in a browser; it cannot be meaningfully driven via MCP. If a user asks for a
no-code/toolbar experiment, point them to the PostHog UI instead of creating one here.)If the user gives enough context to infer these, don't ask — just proceed.
This is about rollout configuration.
Before asking any rollout question, load configuring-experiment-rollout. The disambiguation wording, recommendations, and post-answer branches live there — do not formulate rollout questions yourself, and do not assume an example you remember covers the user's path.
Key decision points (covered in detail by configuring-experiment-rollout):
If the user doesn't mention rollout specifics, use defaults: 50/50 control/test, 100% rollout.
This is about analytics and metrics. Load the configuring-experiment-analytics skill for guidance.
That skill's first step checks for an existing shared metric to reuse before building a new one —
don't duplicate a metric the project already has set up.
Do NOT configure metrics on creation. Metrics are not passed to experiment-create — they are added
afterwards via experiment-update. This keeps the creation call lightweight.
When the user specifies metrics upfront, acknowledge them and add them immediately after creation. When they don't, infer the primary metric from the hypothesis (step 0) and add it after creation; say it was inferred.
If step 0 produced a running-time estimate, pass it to experiment-create as running_time_calculation so the plan is stored on the experiment.
Call experiment-create with:
{
"name": "Descriptive experiment name",
"feature_flag_key": "kebab-case-key",
"description": "Hypothesis: [what you expect to happen]",
"feature_flag": {
"filters": {
"multivariate": {
"variants": [
{ "key": "control", "name": "Control", "rollout_percentage": 50 },
{ "key": "test", "name": "Test", "rollout_percentage": 50 }
]
},
"groups": [{ "properties": [], "rollout_percentage": 100 }]
}
}
}Flag config goes in the feature_flag object, in the flag's own filters shape (not the deprecated parameters keys).
Two different percentages live in there, do NOT mix them up:
filters.multivariate.variants[].rollout_percentage is how users inside the experiment are split across variants (must sum to 100, recommended to have an even split).filters.groups[0].rollout_percentage is the overall gate: what fraction of all users enter the experiment at all (0-100, defaults to 100).Key details:
"control" when present, else the first variant (override with stats_config.baseline_variant_key). Convention: key the baseline "control" unless the user asks for specific keys.filters.groups[0].rollout_percentage defaults to 100 if omitted.ensure_experience_continuity come from step 0. Keep user-id bucketing unless the page crosses identification. Only then, in this order: device-id bucketing when every flag call carries a device ID, else persistence when no SDK evaluates the flag locally, else user-id bucketing. Leave ensure_experience_continuity out unless you are choosing persistence: when omitted, the team's persistence default applies.stats_config if the user asks for a different method.Report the draft in three groups, so the user can review it quickly:
Also say what you could not read: a missing tool, or a section whose status was not ok.
Always show the experiment URL. The experiment-create response includes _posthogUrl — always display this link so the user can view and configure the experiment in the UI.
Remind the user to implement the feature flag in code. Link to the experiment page and say "implement the flag as shown here" — the experiment detail page shows implementation snippets for the user's SDK.
Guide through metrics if not yet configured — load the configuring-experiment-analytics skill.
Launch only when the user asks for it — creation ends at a draft. A launch turns the feature flag on for real users, so never call experiment-launch unprompted.
configuring-experiment-rollout — variant splits, rollout percentage, and who sees the testconfiguring-experiment-analytics — exposure criteria and primary/secondary metricsmanaging-experiment-lifecycle — launch, pause, ship, and end once the experiment exists130f3a1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.