Creating Experiments

作者 PostHog469d1773e9cb無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Guides agents through the 3-step experiment creation flow: defining the hypothesis, configuring rollout, and setting up analytics. 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.

AI 產生的概覽

引導代理透過三步流程在 PostHog 中建立新的 A/B 測試實驗。

功能
此技能引導代理依三步流程建立新的 A/B 測試實驗:定義假設與功能旗標、設定放量,以及設定分析指標。它說明了 experiment-create 呼叫的參數,包括變體分配與整體放量百分比,並將放量與指標決策交由相關技能處理。建立完成後,它指示代理顯示實驗連結、提醒使用者在程式碼中實作該旗標、引導指標設定,並在就緒時啟動實驗。
適用情境
當使用者要求建立新實驗或 A/B 測試時使用,或當代理即將呼叫 experiment-create 時使用。它不適用於更新現有實驗、管理實驗生命週期或僅瀏覽實驗的情境。
執行需求
需要存取 PostHog 實驗相關工具,包括 experiment-create、experiment-update 和 experiment-launch,以及相關技能 configuring-experiment-rollout 和 configuring-experiment-analytics。此技能不含指令碼,僅為說明文件。

Creating experiments

This skill walks through the 3-step flow for creating a new A/B test experiment.

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?

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 "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)
  • Whether to persist the flag across authentication steps

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, create the draft and then guide them through metric setup as a follow-up.

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 }]    },    "ensure_experience_continuity": false  }}

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:

  • Minimum 2, maximum 20 variants. No specific variant key is required — the analysis baseline defaults to the variant keyed "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 persists a user's variant across authentication steps; leave it false unless the flag is shown to both logged-out and logged-in users (see configuring-experiment-rollout).
  • Stats default to Bayesian. Only set stats_config if the user requests Frequentist.

After creation

  1. 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.

  2. 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.

  3. Guide through metrics if not yet configured — load the configuring-experiment-analytics skill.

  4. Launch when ready — use the experiment-launch tool.

Related skills

  • configuring-experiment-rollout — variant splits, rollout percentage, and who sees the test
  • configuring-experiment-analytics — exposure criteria and primary/secondary metrics
  • managing-experiment-lifecycle — launch, pause, ship, and end once the experiment exists

來源與署名

來源:PostHog/ai-plugin位於skills/creating-experiments提交469d177

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 PostHog/ai-plugin 的技能

Writing Simplified Technical English

PostHog

套用 ASD-STE100 簡化技術英語規則,讓代理撰寫的文字語意明確、方便執行。

Writing & Content2026年10月8日

Working With Task Comments

PostHog

透過 PostHog MCP exec 調度器讀取並解讀 PostHog 任務、成品和畫布上的留言。

Productivity & Workflow2026年10月8日

Working With Skills

PostHog

指導代理使用 PostHog 的 skill-* MCP 工具來探索、讀取、建立、更新與重構技能。

AI & Agents2026年10月8日

Working With Scouts

PostHog

說明如何把監看工作委派給 PostHog Signals 偵察代理、處理其回報,並長期調校整個代理團隊的操作手冊。

AI & Agents2026年10月8日

Validating And Publishing Canvases

PostHog

Validate and publish a canvas source project safely: the source-project shape, declared capabilities, reading the current version pointer, iterating on validation diagnostics, guarded publishing with expected_current_version_id, staging a draft build and promoting it, waiting out the queued build, and recovering from a 409 version_conflict or a 429 capacity limit without overwriting concurrent work. Use whenever a canvas edit is ready to save, a draft build is wanted, a canvas publish or build returns diagnostics or a conflict, or a task needs to understand canvas version history.

待分類2026年10月8日

Understanding Billing Usage

PostHog

Explains PostHog billing usage and spend from the customer's visible Billing MCP tools. Use when the user asks why usage or spend is high, which product or project is driving usage, what a usage type means, how to reduce usage, what changed over time, why they got a usage change alert, or whether a spike/drop alert was real or noisy. Also use before product-specific analytics skills when the user names a billable PostHog product metric such as events, recordings, feature flag requests, exceptions, survey responses, synced rows, logs, AI events, AI credits, or Inbox credits. Starts from Billing usage/spend tools, then routes to customer-visible product MCP surfaces for deeper investigation.

待分類2026年10月8日