/ai-analyst-plus:experimentfrom ai-analyst-plus
Owns the full experiment lifecycle: design, power analysis, statistical analysis, interpretation, and ship decisions for A/B tests. Invoke as /experiment or on experiment-related intents.
Ships in ai-analyst-plus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
If the skill install path cannot be resolved (some sandboxed environments): read the script file(s) from this skill, write a copy into a scripts/ folder inside the working folder, and run from there. The scripts are self-contained.
Multi-mode skill for the full experiment lifecycle — from design through analysis to ship/no-ship decision. Orchestrates the experiment plugin agents and calls the coded statistical library bundled in this skill at scripts/experiment_stats/ instead of improvising Python.
Using the bundled library: add this skill's scripts/ directory to sys.path, then import, e.g.
import sys
sys.path.insert(0, "<path to this skill>/scripts") # the scripts/ dir next to this SKILL.md
from experiment_stats import srm_check
Requires pandas, numpy, and scipy; power.py and corrections.py also need statsmodels (install it in the sandbox if missing).
Invoke as /experiment [mode] or trigger on experiment-related intents:
/experiment designPurpose: Create a pre-registered experiment config.
Agent: the experiment-designer plugin agent
Flow:
experiments/{slug}/experiment.yaml (from templates/experiment.yaml)
Checkpoint: Config review (Type B — skippable with --just-do-it)/experiment powerPurpose: Power analysis + duration estimation. Flow:
experiments/{slug}/experiment.yaml for metric type, baseline, MDEscripts/experiment_stats/power.py):
power_proportion(baseline_rate, mde)power_mean(baseline_mean, baseline_std, mde)duration_estimate(total_sample, daily_traffic, allocation)experiment.yaml with computed values (sample_size, duration, viable)/causal select as alternative
Checkpoint: Power viability (Type C — NOT_VIABLE fires mandatory checkpoint)/experiment analyzePurpose: Run statistical tests on experiment data.
Agent: the experiment-analyzer plugin agent
Flow:
experiments/{slug}/experiment.yaml for pre-registered configfrom experiment_stats import srm_check
# Positional lists ONLY — do not pass dicts.
# First arg: observed counts per variant (order must match expected_ratios).
# Second arg: expected allocation ratios, summing to 1.0.
result = srm_check([4218, 4196], [0.5, 0.5])
# result = {"chi2_stat": 0.058, "p_value": 0.81, "verdict": "PASS", ...}
if result["verdict"] == "BLOCK":
# HALT — do not proceed to treatment effect analysis
from experiment_stats import welch_test, proportion_test, ratio_metric_test
# Select based on metric type from experiment.yaml
if metric_type == "proportion":
result = proportion_test(c_success, c_n, t_success, t_n)
elif metric_type == "continuous":
result = welch_test(control_values, treatment_values)
elif metric_type == "ratio":
result = ratio_metric_test(num_c, den_c, num_t, den_t)
cohens_d(control, treatment)adjust_pvalues(all_p_values, method="holm")experiments/{slug}/working/analysis_results.json
Checkpoint: SRM gate (Type C — BLOCK halts everything)/experiment interpretPurpose: Walk the Result Interpretation Tree and classify the outcome.
Agent: the experiment-interpreter plugin agent
Flow:
experiments/{slug}/working/analysis_results.json/experiment reportPurpose: Generate markdown report from analysis results.
Agent: the experiment-readout plugin agent
Flow:
templates/experiment-report.md)experiments/{slug}/reports/experiment_report_{{DATE}}.md/experiment monitorPurpose: SRM check + guardrail status + sample tracking during a running experiment.
Agent: the experiment-monitor plugin agent
Flow:
srm_check() with p < 0.0005 threshold (Microsoft production standard)experiments/{slug}/working/monitoring_update.md
/experiment statusPurpose: Show experiment lifecycle state. Flow:
experiments/{slug}/experiment.yaml/experiment fullPurpose: End-to-end: design → power → analyze → interpret → report. Flow: Runs design, power, analyze, interpret, report in sequence. Checkpoints: All Type C checkpoints fire. Type B skipped with --just-do-it.
experiments/{slug}/
├── experiment.yaml # Pre-registered config (tracked)
├── working/ # Intermediates (gitignored)
│ ├── analysis_results.json
│ ├── monitoring_update.md
│ └── ...
└── reports/ # Final reports (tracked)
└── experiment_report_{{DATE}}.md
All statistical work uses the coded library bundled at scripts/experiment_stats/:
| Function | Module | Use For |
|---|---|---|
welch_test() | ab_tests | Continuous metric A/B test |
proportion_test() | ab_tests | Binary metric A/B test |
ratio_metric_test() | ab_tests | Ratio metric (delta method) |
winsorize() | ab_tests | Outlier-robust pre-processing |
power_proportion() | power | Sample size for proportions |
power_mean() | power | Sample size for means |
detectable_effect() | power | MDE from fixed sample |
duration_estimate() | power | Timeline planning |
srm_check() | srm | Sample ratio mismatch |
srm_diagnose() | srm | Segmented SRM root cause |
cohens_d() | effect_size | Standardized effect size |
relative_lift() | effect_size | Percentage change |
adjust_pvalues() | corrections | Multiple comparison correction |
cuped_adjust() | variance_reduction | CUPED variance reduction |
confidence_sequence() | sequential | Always-valid CI (peeking ok) |
bayesian_proportion() | bayesian | Bayesian A/B (proportions) |
bayesian_mean() | bayesian | Bayesian A/B (means) |
/experiment power → NOT_VIABLE → suggest /causal select (quasi-experimental)/causal select → "Can you randomize? YES" → suggest /experiment design/experiment analyze → SRM BLOCK → suggest investigating assignment logicscripts/experiment_stats/__init__.py (opens in a new tab)scripts/experiment_stats/ab_tests.py (opens in a new tab)scripts/experiment_stats/bayesian.py (opens in a new tab)scripts/experiment_stats/corrections.py (opens in a new tab)scripts/experiment_stats/effect_size.py (opens in a new tab)scripts/experiment_stats/power.py (opens in a new tab)scripts/experiment_stats/sequential.py (opens in a new tab)scripts/experiment_stats/srm.py (opens in a new tab)scripts/experiment_stats/variance_reduction.py (opens in a new tab)templates/experiment-report.md (opens in a new tab)templates/experiment.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ai-analyst-lab/ai-analyst-plugin --plugin ai-analyst-plus47 skills in this plugin
/always-compareNever present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available. Use every time you show a number: rates, counts, revenue, averages, query results, chart labels, summary stats. Trigger on output containing "the rate is", "we saw", "total", "average", "conversion", "revenue", "users", "sessions", "churn", "AOV", "NPS", or any figure pulled from data./analysis-designTurn a vague hunch or stakeholder request into a rigorous analysis plan via a staged pipeline (hypothesis sharpening, confound scan, V1, feedback, V2 redesign). Trigger on "I think X caused Y", "design an analysis for", "what's driving", "V2 after feedback", "stakeholder comments", "redesign the analysis". Vs question-framing (the lightweight framing gate before every analysis): use THIS only for a real hunch, confound scan, or V1 to V2 redesign./analyst-coreOperating rules for every data analysis. Apply for ANY data-analysis intent: "analyze", "investigate", "why did X change", "compare", "report on", "dashboard", "metrics", "funnel", "retention", "revenue", "conversion", "trend", "segment", "forecast", "how are we doing", "dig into", "break down", or any question about data, a metric, a CSV, or a table. Sets the method and routes to the other skills; load before any analytical question.Other plugins' skills for the same job