中级Agent Skill

实验设计

先用 A/B 测试样本量计算判断实验是否跑得起来,再安排具体测试。提供当前转化率、值得识别的最小提升和预计流量后,这项 Skill 会结合 Python 计算整理实验假设、指标、停止规则与业务保护条件,帮助团队避免在样本不足时急于判断哪个版本更好。

浏览量
0
复制次数
0
收藏
0
编辑评分
84/100
01

这个 Skill 是做什么的

一个完整实验不只是准备两个页面版本,还要明确当前基线、希望识别多大的变化,以及团队愿意承担怎样的误判风险。这项 Skill 会把基线转化率、最小可检测差异、显著性水平和统计功效写清楚,再联系业务问题与执行条件。

适合在转化率测试上线前使用。配套计算器针对文档说明的两个比例比较,不适用于直接计算客单价等连续指标或多变量实验。流量分组、数据收集和线上执行仍需由现有测试平台或实现完成。

02

它有什么特色

01

方法与优势

Python 计算器把样本估算的前提公开列出,包括提升是按绝对变化还是相对变化输入。团队可以先统一目标口径,避免同样说“提升几个点”,实际使用了不同含义,最后误判所需样本与测试投入。

02

适用任务

样本计算旁边还会明确假设、指标、停止规则和业务保护条件。预计流量帮助判断实验是否现实可行,提前约定判断方式则能减少看到某个有利结果就立即结束测试的问题,让结论更容易复核。

03

安装前的特殊要求

需要准备的输入

基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。

Agent 与运行环境

使用支持 Skill 且能访问文件的 Agent。随包 Python 辅助工具需要 Python 3;提供数据前先查看样例结构。

需确认的适用边界

计算器适用于文档规定的两比例假设,不是通用连续指标或多变量实验引擎,也不会启动实验。

04

安装与开始使用

将指令复制给 Codex 或 Claude Code,让助手从原始仓库下载固定提交,安装完整文件并检查所需依赖。

  1. 打开能访问本机文件和终端的 Codex 或 Claude Code。
  2. 复制下方指令发给正在使用的应用,由助手选择该应用的安装目录。
  3. 查看返回的安装路径和文件检查结果;需要时新建会话,再要求助手使用已安装的 Skill。
请在我当前使用的应用中安装 experiment-designer,直接执行文件安装,不要只解释步骤。 原始仓库:https://github.com/alirezarezvani/claude-skills.git 固定提交:6d2f02ea077eead1bee5411a31bcc6db5a11a70c Skill 路径:product-team/skills/experiment-designer 1. 将这个版本下载到新目录。执行随包脚本前,先阅读 SKILL.md 和安装参考文件,不替换成其他作者的包。 2. Codex 安装到 ~/.agents/skills/experiment-designer,Claude Code 安装到 ~/.claude/skills/experiment-designer,只安装到我正在使用的应用。安装完整 Skill 文件夹,保留 scripts、references、assets 和随包声明;将仓库根目录许可证一并保留。先检查所有目标目录;已有安装时,说明差异后再决定是否替换。 3. 比较来源和安装目录的文件清单、文件哈希,检查文档要求的运行时、依赖及外部连接。只配置此 Skill 所需的本地依赖,适用时使用隔离环境;账号登录由我在本地完成,不把凭据贴进聊天。 4. 返回来源提交、实际安装路径、文件检查结果及尚未完成的运行环境配置,说明如何调用 experiment-designer。文件复制与应用发现分别检查,需要时新建会话。不要执行生产任务,也不要把安装完成说成已确认业务效果。
05

原始 Skill.md

以下为已核对版本未经改写的 SKILL.md。安装完整包才能保留引用的脚本、素材和指引。下方启动提示词为 EcomAgentTools 编写的示例。

---
name: experiment-designer
description: Use when planning product experiments, writing testable hypotheses, estimating sample size, prioritizing tests, or interpreting A/B outcomes with practical statistical rigor.
---

# Experiment Designer

Design, prioritize, and evaluate product experiments with clear hypotheses and defensible decisions.

## When To Use

Use this skill for:
- A/B and multivariate experiment planning
- Hypothesis writing and success criteria definition
- Sample size and minimum detectable effect planning
- Experiment prioritization with ICE scoring
- Reading statistical output for product decisions

## Core Workflow

1. Write hypothesis in If/Then/Because format
- If we change `[intervention]`
- Then `[metric]` will change by `[expected direction/magnitude]`
- Because `[behavioral mechanism]`

2. Define metrics before running test
- Primary metric: single decision metric
- Guardrail metrics: quality/risk protection
- Secondary metrics: diagnostics only

3. Estimate sample size
- Baseline conversion or baseline mean
- Minimum detectable effect (MDE)
- Significance level (alpha) and power

Use:
```bash
python3 scripts/sample_size_calculator.py --baseline-rate 0.12 --mde 0.02 --mde-type absolute
```

4. Prioritize experiments with ICE
- Impact: potential upside
- Confidence: evidence quality
- Ease: cost/speed/complexity

ICE Score = (Impact * Confidence * Ease) / 10

5. Launch with stopping rules
- Decide fixed sample size or fixed duration in advance
- Avoid repeated peeking without proper method
- Monitor guardrails continuously

6. Interpret results
- Statistical significance is not business significance
- Compare point estimate + confidence interval to decision threshold
- Investigate novelty effects and segment heterogeneity

## Hypothesis Quality Checklist

- [ ] Contains explicit intervention and audience
- [ ] Specifies measurable metric change
- [ ] States plausible causal reason
- [ ] Includes expected minimum effect
- [ ] Defines failure condition

## Common Experiment Pitfalls

- Underpowered tests leading to false negatives
- Running too many simultaneous changes without isolation
- Changing targeting or implementation mid-test
- Stopping early on random spikes
- Ignoring sample ratio mismatch and instrumentation drift
- Declaring success from p-value without effect-size context

## Statistical Interpretation Guardrails

- p-value < alpha indicates evidence against null, not guaranteed truth.
- Confidence interval crossing zero/no-effect means uncertain directional claim.
- Wide intervals imply low precision even when significant.
- Use practical significance thresholds tied to business impact.

See:
- `references/experiment-playbook.md`
- `references/statistics-reference.md`

## Tooling

### `scripts/sample_size_calculator.py`

Computes required sample size (per variant and total) from:
- baseline rate
- MDE (absolute or relative)
- significance level (alpha)
- statistical power

Example:
```bash
python3 scripts/sample_size_calculator.py \
  --baseline-rate 0.10 \
  --mde 0.015 \
  --mde-type absolute \
  --alpha 0.05 \
  --power 0.8
```
06

开始使用

以下是主要功能的用例提示词,可以直接复制使用。

01

估算结账转化实验样本量

估算结账转化实验样本量 适用于:估算结账转化实验样本量。请准备:基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。

查看 Prompt 和变量收起 Prompt 和变量
请使用已安装的 experiment-designer Skill。任务:估算结账转化实验样本量。输入:[INPUT]。限制:[CONSTRAINTS]。先检查缺失信息,再输出可审查的结果、依据、假设和下一步。计算器适用于文档规定的两比例假设,不是通用连续指标或多变量实验引擎,也不会启动实验。

需要替换的变量

[INPUT]
基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。
[CONSTRAINTS]
任务范围、允许的操作、输出格式和审核要求。
02

根据明确证据与成本排列测试想法

根据明确证据与成本排列测试想法 适用于:根据明确证据与成本排列测试想法。请准备:基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。

查看 Prompt 和变量收起 Prompt 和变量
请使用已安装的 experiment-designer Skill。任务:根据明确证据与成本排列测试想法。输入:[INPUT]。限制:[CONSTRAINTS]。先检查缺失信息,再输出可审查的结果、依据、假设和下一步。计算器适用于文档规定的两比例假设,不是通用连续指标或多变量实验引擎,也不会启动实验。

需要替换的变量

[INPUT]
基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。
[CONSTRAINTS]
任务范围、允许的操作、输出格式和审核要求。
03

在实验开始前写明判定条件和护栏

在实验开始前写明判定条件和护栏 适用于:在实验开始前写明判定条件和护栏。请准备:基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。

查看 Prompt 和变量收起 Prompt 和变量
请使用已安装的 experiment-designer Skill。任务:在实验开始前写明判定条件和护栏。输入:[INPUT]。限制:[CONSTRAINTS]。先检查缺失信息,再输出可审查的结果、依据、假设和下一步。计算器适用于文档规定的两比例假设,不是通用连续指标或多变量实验引擎,也不会启动实验。

需要替换的变量

[INPUT]
基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。
[CONSTRAINTS]
任务范围、允许的操作、输出格式和审核要求。
07

实际使用案例:为运费说明测试计算样本并解读模拟结果

商家准备测试购买按钮旁增加运费说明,基线购买率 2.5%,希望检测到至少 0.5 个百分点提升。输入包括每日流量和完整模拟结果。

使用步骤与 Prompt

  1. 准备下方案例输入资料,保留商品、政策和经营记录中的金额、单位及时间口径。
  2. 确定分组、七天购买指标、护栏和样本需求,再按预设门槛分析给定实验数据、置信区间与成本。
  3. 提交下方完整 Prompt,查看右侧主要产物;需要交接给同事时,下载包含全部交付文件的压缩包。

案例输入资料:business-inputs.zip

Use the experiment-designer Skill.

Design a controlled test of the proposed product-page change using our traffic and purchase baseline. Define the unit of randomization, seven-day purchase metric, guardrails, sample size, enrollment duration and analysis rule. Then analyze the supplied experiment dataset, including confidence intervals and costs, against the decision thresholds.

The attached business materials are:
- inputs/merchant.json
- inputs/operating-brief.json
- inputs/synthetic_outcome.json

Deliver a complete result.md report that the operations team can read, plus any finished files needed for this task. Keep supporting calculations and evidence with the deliverables. Write the report in English; use the requested target language for customer-facing copy. The business datasets are fictional examples unless the brief explicitly names a live public website.

运行结果

下方直接展示本次 Prompt 产生的主要文件,保留实际输出语言。

Product-page experiment: positive estimate, practical threshold not cleared

The supplied synthetic outcome has a positive purchase-rate difference, but its 95% confidence interval does not establish the required minimum improvement of 0.5 percentage points. Under the frozen decision rule, do not label this an unconditional launch win. This is an actual analysis of a fictional dataset, not a live experiment performed on shoppers.

Predefined design

If the page puts the $24 price, $5 one-mug US shipping charge and hand-wash/no-microwave restrictions beside Add to cart, then seven-day purchase probability should rise from 2.5% toward at least 3.0%, because shoppers can evaluate cost and care before committing. Hold price, targeting and other page content constant.

Randomize unique eligible shoppers 50:50, persist assignment across visits and analyze by first assigned variant. The primary measure is at least one paid, non-test purchase within seven days of first exposure, divided by all assigned eligible shoppers. Count each shopper once; orders/sessions is not a substitute. Track exposure, assignment and transaction deduplication before enrollment.

Guardrails: pause on instrumentation errors; investigate checkout-error increases of at least 0.5 percentage points and 30-day returned-order increases of at least one percentage point using matched denominators. Observe stock and fulfillment changes that could invalidate the comparison. Evaluate guardrails continuously for operational safety; do not repeatedly test the primary metric for an early win.

Sample and timing

The original Skill's calculator ran with baseline 0.025, absolute MDE 0.005, two-sided alpha 0.05 and power 0.80. It returns 16,793 per group, 33,586 total. At 600 newly eligible shoppers a day total, enrollment takes 56 days. Allow seven more days for the last entrant's purchase window: approximately 63 days for the purchase readout. A 30-day return window after the last qualifying purchase can require roughly 93 days from enrollment start. Actual calendar timing depends on exposure and purchase timestamps.

Freeze the assignment, sample threshold, attribution window and analysis before starting. Run through whole weeks and wait for maturity; do not reuse the outcome dataset's assumptions as proof that real instrumentation and return windows passed.

Recomputed outcome

MeasureControlVariant
Eligible shoppers16,79316,793
Purchasers420537
Seven-day purchase rate2.5010%3.1978%

Absolute difference: 0.6967 percentage points. Relative difference: 27.86%. Unpooled Wald 95% interval: 0.3409 to 1.0525 percentage points. Pooled two-proportion z-test, two-sided p = 0.00012448. These were calculated from counts, not copied from the supplied summary fields.

Counts are exactly balanced; that alone cannot verify assignment implementation. The fixture assumes mature observations and acceptable guardrails but provides no underlying event log or guardrail counts. Treat those as exercise assumptions.

Costs and decision

For a proposed 12-week rollout at 600 shoppers/day, the economic scenario covers 50,400 shoppers. At the supplied $12 incremental contribution per additional order, one-time $120 implementation and $20/week operating cost, total fixed/operating cost is $360. Applying the effect interval to that scenario yields modeled net contribution of $1,701.89 to $6,005.62, with point estimate $3,853.76. This is a projection under stated contribution and traffic assumptions, not achieved revenue or profit.

Statistical evidence against zero is strong in the fixture. The lower bound (0.003409) remains below the preselected 0.005 practical threshold, so the strict rule fails. Keep the factual information improvements as a separate product-quality decision if necessary, but do not redefine the experiment's success threshold after seeing results. Investigate comprehension and design a fresh test if the merchant still requires evidence of a 0.5-point minimum effect.

The package includes the original calculator output and independently recomputed analysis.json. No live traffic was randomized and no production page was changed by this case execution.

案例中的商家经营资料为模拟数据;涉及网站检查时,报告中的页面观察来自所列公开网址。

08

风险与使用注意事项

已知限制

计算器适用于文档规定的两比例假设,不是通用连续指标或多变量实验引擎,也不会启动实验。

证据与复核

核对源码及随包文件:GitHub 6d2f02ea077e。本次为静态审查,不代表已完成安装运行或业务效果测试。

采用结果前

使用获授权输入,不把密钥贴入提示词。采用前检查面向客户的声明、计算、代码改动及任何拟议的外部操作。

常见问题

它能做什么,有什么优势?

规划测试假设、指标、停止规则和转化率样本量。Python 计算器明确使用基线、最小可检测效应、显著性和功效参数。

如何安装和开始使用?

按实际 Agent 选择方式,安装完整包,不要只复制页面中的 SKILL.md。 基线转化率、绝对或相对 MDE、流量、分流比例、alpha、功效和业务护栏。 开启新 Agent 会话,明确要求使用 experiment-designer。先用小型样本尝试下方一个场景,并检查输出。

适合哪些使用场景?

估算结账转化实验样本量;根据明确证据与成本排列测试想法;在实验开始前写明判定条件和护栏

使用前需要了解哪些限制?

计算器适用于文档规定的两比例假设,不是通用连续指标或多变量实验引擎,也不会启动实验。

本页核对了什么?

核对源码及随包文件:GitHub 6d2f02ea077e。本次为静态审查,不代表已完成安装运行或业务效果测试。

暂无评论。

发表评论

请先为每一项打分,再分享你的真实使用体验。

任务有效性
安装与使用难度
稳定性与边界
文档清晰度
首次获得有效结果
作者 / 维护者

Alireza Rezvani

核对源码及随包文件:GitHub 6d2f02ea077e。本次为静态审查,不代表已完成安装运行或业务效果测试。