creating-experiments
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreating experiments
创建实验
This skill walks through the 3-step flow for creating a new A/B test experiment.
本Skill引导完成创建新A/B测试实验的三步流程。
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.
快速将实验创建为草稿,然后迭代优化指标和配置。用户可立即获得一个有形的草稿,并对其进行完善。
The 3-step creation flow
三步创建流程
Step 1: What are we testing?
步骤1:我们要测试什么?
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. Ask if they want a new flag or to reuse an existing one. The flag is auto-created — do NOT create one separately.
- Type — leave empty (will internally default to . The
"product"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.)"web"
If the user gives enough context to infer these, don't ask — just proceed.
在调用之前,收集以下信息:
experiment-create- 实验名称 —— 描述性名称,尽可能从上下文推断
- 假设 —— 您预期会发生的情况(填入字段)
description - 功能标识键(Feature flag key) —— 使用短横线分隔格式(kebab-case)。询问用户是要创建新标识还是复用现有标识。标识会自动创建——请勿单独创建。
- 类型 —— 留空(内部默认值为。
"product"值专为通过浏览器中的PostHog工具栏可视化配置的无代码实验保留;无法通过MCP有效驱动。如果用户要求创建无代码/工具栏实验,请引导他们使用PostHog UI,而非在此处创建。)"web"
如果用户提供的上下文足够推断这些信息,无需询问,直接继续。
Step 2: Who sees what variant?
步骤2:哪些用户会看到哪个变体?
This is about rollout configuration.
Before asking any rollout question, load . 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.
configuring-experiment-rolloutKey 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)
- Whether to persist the flag across authentication steps
If the user doesn't mention rollout specifics, use defaults: 50/50 control/test, 100% rollout.
这部分涉及发布配置。
在询问任何发布相关问题之前,请加载。 歧义消除措辞、建议以及回答后的分支逻辑都在该Skill中——请勿自行设计发布相关问题,也不要假设您记得的示例能覆盖用户的所有路径。
configuring-experiment-rollout关键决策点(中有详细说明):
configuring-experiment-rollout- 变体分配比例(有多少个变体,每个变体的占比)
- 整体发布比例(有多少百分比的所有用户会进入实验)
- 是否在身份验证步骤之间保留标识
如果用户未提及发布细节,使用默认值:对照组/测试组各50%,100%发布。
Step 3: How to measure impact?
步骤3:如何衡量影响?
This is about analytics and metrics. Load the skill for guidance.
configuring-experiment-analyticsDo NOT configure metrics on creation. Metrics are not passed to — they are added
afterwards via . This keeps the creation call lightweight.
experiment-createexperiment-updateWhen the user specifies metrics upfront, acknowledge them and add them immediately after creation.
When they don't, create the draft and then guide them through metric setup as a follow-up.
这部分涉及分析和指标。加载 Skill获取指导。
configuring-experiment-analytics请勿在创建时配置指标。 指标不会传递给——而是在创建后通过添加。这样可以让创建调用更轻量化。
experiment-createexperiment-update如果用户预先指定了指标,请确认并在创建后立即添加。如果未指定,先创建草稿,然后引导他们后续完成指标设置。
How to create
创建方法
Call with:
experiment-createjson
{
"name": "Descriptive experiment name",
"feature_flag_key": "kebab-case-key",
"description": "Hypothesis: [what you expect to happen]",
"parameters": {
"feature_flag_variants": [
{ "key": "control", "name": "Control", "split_percent": 50 },
{ "key": "test", "name": "Test", "split_percent": 50 }
],
"rollout_percentage": 100
}
}Two different percentages — do NOT mix them up:
- — how users inside the experiment are split across variants (must sum to 100, recommended to have an even split).
feature_flag_variants[].split_percent - — what fraction of all users enter the experiment at all (0-100, defaults to 100).
parameters.rollout_percentage
Key details:
- First variant must have key . Minimum 2, maximum 20 variants.
"control" - defaults to 100 if omitted.
rollout_percentage - Stats default to Bayesian. Only set if the user requests Frequentist.
stats_config
调用时传入以下参数:
experiment-createjson
{
"name": "Descriptive experiment name",
"feature_flag_key": "kebab-case-key",
"description": "Hypothesis: [what you expect to happen]",
"parameters": {
"feature_flag_variants": [
{ "key": "control", "name": "Control", "split_percent": 50 },
{ "key": "test", "name": "Test", "split_percent": 50 }
],
"rollout_percentage": 100
}
}注意两个不同的百分比——请勿混淆:
- —— 实验内用户在各变体间的分配比例(总和必须为100,建议平均分配)。
feature_flag_variants[].split_percent - —— 所有用户中进入实验的比例(0-100,默认值为100)。
parameters.rollout_percentage
关键细节:
- 第一个变体的键必须为。变体数量最少2个,最多20个。
"control" - 如果省略,默认值为100。
rollout_percentage - 统计方法默认采用贝叶斯法。仅当用户要求使用频率主义法时,才设置。
stats_config
After creation
创建后操作
-
Always show the experiment URL. Theresponse includes
experiment-create— always display this link so the user can view and configure the experiment in the UI._posthogUrl -
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 theskill.
configuring-experiment-analytics -
Launch when ready — use thetool.
experiment-launch
-
始终展示实验URL。的响应包含
experiment-create——务必显示此链接,以便用户在UI中查看和配置实验。_posthogUrl -
提醒用户在代码中实现功能标识。 链接到实验页面并说明“按此处所示实现标识”——实验详情页面会显示适用于用户SDK的代码片段。
-
如果尚未配置指标,引导用户完成设置——加载Skill。
configuring-experiment-analytics -
准备就绪后启动实验——使用工具。
experiment-launch