creating-experiments
Guides agents through experiment creation: reading the project's setup with experiment-setup-context, defining the hypothesis, configuring rollout and…
Skill by PostHogOfficial
Chalk Labs
Need help deploying creating-experiments?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/posthog-creating-experiments-d5f66b
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
creating-experiments- Description
- 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.
- License
- MIT
- Instructions
- 158 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- setup-decisions.md · references/
SKILL.md (first lines)
# Creating experiments
This skill walks through creating a new A/B test experiment: read the project, then the 3-step flow, then report the draft.
## Core principle: draft first, iterate on details
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.
Bucketing is the exception: the facts cannot decide it, so ask before you create the experiment.
## Step 0: Read the project
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.
1. From the request, infer the **target** (the event that marks someone reaching the change, usually `$pageview` 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.
For a page, read `event_property_values` for `$host` and `$pathname` on the target event as well.
The response samples the values rather than listing them all, so read it for the shape the project records (a trailing slash, a `www.` prefix, the casing) rather than as proof that a value is absent.
An exact filter has to carry that shape: `/pricing` matches nothing where every pageview says `/pricing/`, and `example.com` matches nothing where the host is `www.example.com`.
2. If the `experiment-setup-context` tool is available, call it once with `target_event` and `metric_event`.
For a web surface, add `target_properties` with an exact `$host`.
Add an exact `$pathname` as well when the surface is one page.
`target_url_contains` is a substring match on `$current_url`.
A bare domain matches any host that contains it, `notexample.com` included, and a homepage path matches every page under it.
Both overstate the traffic and the exposure rate.
For a surface that spans several pages, keep the exact `$host` and put only the path fragment in `target_url_contains`.
Add `metric_properties` in the same call when the candidate metric counts only some occurrences of its event.
Pass `previous_experiments_limit: 5`. Five experiments are enough to read a precedent, and the default of 10 roughly doubles the response for no more signal.
If the tool is not available, continue without it and treat every choice below as a best guess. Never call a tool you can't see.
Each filter needs a `type` of `event` or `person`, a `key`, an `operator` and a `value`.
The call rejects the `flag_evaluates_to` operator with a 400 that names it.
For the homepage of one domain:
```json
{
"target_event": "$pageview",
"target_properties": [
{ "key": "$host", "type": "event", "operator": "exact", "value": ["www.example.com"] },
{ "key": "$pathname", "type": "event", "operator": "exact", "value": ["/"] }
],
"metric_event": "your_conversion_event",
"previous_experiments_limit": 5
}
```
3. Apply [references/setup-decisions.md](references/setup-decisions.md) to the result. It maps each fact to a choice (bucketing, where the flag is evaluated, exposure, primary metric, running time, precedent) and to a tier for the summary.
4. Carry those choices into steps 1 to 3.
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.
## The 3-step creation flow
### Step 1: What are we testing?
Gather these before calling `experiment-create`:
- **Experiment name** — descriptive, inferred from context when possible
- **Hypothesis** — what you expect to happen (goes in `description`)
- **Feature flag key** — kebab-case. Infer a new key unless the user names an existing flag.
The flag is auto-created — do NOT create one separately. The one exception is device-id bucketing, which `experiment-create` cannot set (see the recipe in `configuring-experiment-rollout`).
- **Type** — leave empty (will internally default to `"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.
### Step 2: Who sees what variant?
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`):
- Variant split (how many variants, what percentage each)
- Overall rollout percentage (what % of all users enter the experiment)
- Bucketing and whether to persist the flag across authentication steps — the user chooses, because the project's facts cannot decide it
If the user doesn't mention rollout specifics, use defaults: 50/50 control/test, 100% rollout.
### Step 3: How to measure impact?
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.
## How to create
Call `experiment-create` with:
```json
{
"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 }]
}
}
}From PostHog/skills, MIT.
Signals
- Stars
- 75
- Forks
- 8
- Open issues
- 2
- Last commit (this folder)
- Sep 26, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/PostHog/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from PostHog
- 0.759score
PostHog MCP Server
PostHogOfficial
Official PostHog MCP Server for product analytics, feature flags, experiments, and more.
ConnectorAFreshness: ARemote★ 40.4KClaude Code +3 - 0.754score
code-reviewer
PostHog
Subagent "code-reviewer" from PostHog/posthog: Use this agent when you need expert code review of recently written or modified code.
TemplateAFreshness: A★ 40.4KClaude Code - 0.683score
authoring-log-alerts
PostHogOfficial
Author useful, low-noise log alerts on services in a PostHog project.
SkillAFreshness: A★ 95Claude Code +9 - 0.683score
auditing-experiments-flags
PostHogOfficial
Audit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations.
SkillAFreshness: A★ 95Claude Code +9 - 0.683score
analyzing-offline-evaluations
PostHogOfficial
Inspect and compare offline AI evaluation experiments, diagnose case-level regressions, and follow scorer history across application, model, or prompt changes.
SkillAFreshness: A★ 95Claude Code +9 - 0.683score
authoring-error-tracking-alerts
PostHogOfficial
Author error tracking alerts that fire when an issue is created, reopened, or starts spiking.
SkillAFreshness: A★ 95Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get creating-experiments running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
creating-experiments skill. Agent Mart. https://agentmart.dev/skills/posthog-creating-experiments-d5f66b (last updated 2026-10-24)