/ai-analyst-plus:distribution-profilerfrom ai-analyst-plus
Profiles the statistical distribution of a numeric data column: identifies distribution type, valid summary stats, recommended tests, and A/B guidance. Use before any analysis involving a numeric metric.
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.
Take any numeric data column and produce a complete analytical playbook: identify the distribution, compute the right summary statistics, recommend the correct statistical tests, flag common traps, and give specific A/B testing guidance.
This skill exists because the #1 mistake in product analytics is assuming data is normal when it's not — leading to wrong tests, false positives, and misleading dashboards. The profiler catches this automatically.
/distribution-profiler — profile a data column's distribution
Figure out what column/metric the user wants profiled. This could be:
If unclear, ask. If the user hasn't specified, look at what they're analyzing and suggest the most relevant metric to profile.
Write and execute a Python script to extract the target column from the active
dataset. Resolve the data source yourself: read .knowledge/active.yaml for the
active dataset id, then that dataset's manifest.yaml for connection details
(source type, file paths, schema prefix).
For connector-attached warehouses, query through the connector. For local DuckDB or CSV sources, connect directly in Python (a read-only DuckDB connection, or pandas over the CSV files).
For per-user metrics (revenue per user, sessions per user), aggregate first — the unit of analysis matters. Profile the metric at the level it will be used in the analysis (per-user, per-session, per-day, etc.).
Write and execute a single Python script that computes all diagnostics. The script should print results as structured output that you'll use to build the report.
Core diagnostics to compute:
import numpy as np
from scipy import stats
# --- Data basics ---
n = len(x)
n_zeros = (x == 0).sum()
pct_zeros = n_zeros / n
n_unique = len(np.unique(x))
is_integer = np.all(x == np.floor(x))
x_min, x_max = x.min(), x.max()
# --- Central tendency ---
mean = np.mean(x)
median = np.median(x)
mean_median_ratio = mean / median if median != 0 else float('inf')
# --- Spread ---
sd = np.std(x, ddof=1)
cv = sd / mean if mean != 0 else float('inf')
iqr = stats.iqr(x)
mad = stats.median_abs_deviation(x)
# --- Shape ---
skewness = stats.skew(x)
excess_kurtosis = stats.kurtosis(x, fisher=True)
# --- Distribution-specific diagnostics ---
vmr = np.var(x, ddof=1) / mean if mean != 0 else float('inf') # for counts
# --- Formal tests ---
# Normality (on raw data)
if n <= 5000:
shapiro_stat, shapiro_p = stats.shapiro(x)
anderson_result = stats.anderson(x, dist='norm')
# Normality of log-transformed data (if all positive)
if x_min > 0:
log_x = np.log(x)
shapiro_log_stat, shapiro_log_p = stats.shapiro(log_x)
# Bimodality
bimodality_coeff = (skewness**2 + 1) / (excess_kurtosis + 3)
Key decision points the diagnostics must answer:
Use the diagnostic results and the Identification Flowchart in this skill's
bundled reference, reference/statistical-distributions.md (in this skill's
directory, next to this SKILL.md), to identify the most likely distribution.
Read that distribution's card in the reference for the details on valid summary stats, tests, transformations, and A/B implications.
Report your confidence level:
Produce a clear, actionable report with these sections. Be specific and concrete — use the actual numbers from the diagnostics, not generic advice.
## Distribution Profile: [metric name]
### 1. Distribution: [Name] (confidence: high/moderate/low)
[One sentence: what distribution this is and why it makes sense for this metric.]
[If moderate/low confidence, list alternatives.]
### 2. Key Diagnostics
| Diagnostic | Value | What It Tells Us |
|-----------|-------|------------------|
| n | ... | Sample size |
| Mean | ... | ... |
| Median | ... | ... |
| Mean/Median ratio | ... | [>1.3 = right-skewed; near 1 = symmetric] |
| SD | ... | ... |
| MAD | ... | [Robust alternative to SD] |
| CV (SD/Mean) | ... | [~1 = exponential; >1.5 = heavy tail] |
| Skewness | ... | ... |
| Excess kurtosis | ... | ... |
| % zeros | ... | [if relevant] |
| VMR (Var/Mean) | ... | [for counts: ~1 Poisson, >>1 NB] |
**Shapiro-Wilk (normality):** p = ... → [reject/fail to reject]
**Shapiro-Wilk (log-normality):** p = ... → [reject/fail to reject] (if applicable)
### 3. Valid Summary Statistics
Use these to describe this metric:
- **Central tendency:** [median / geometric mean / mean — with reasoning]
- **Spread:** [IQR / MAD / CV — with reasoning]
- **Avoid:** [what NOT to report and why]
### 4. Recommended Statistical Tests
| Purpose | Recommended Test | Why |
|---------|-----------------|-----|
| Compare two groups | ... | ... |
| Regression | ... | ... |
| Confidence intervals | ... | ... |
### 5. A/B Testing Playbook
- **Recommended approach:** [specific method]
- **Sample size impact:** [how this distribution affects required n]
- **Effect size measure:** [what to use instead of / in addition to Cohen's d]
- **Common traps:** [specific warnings for this distribution]
- **Practical tip:** [one concrete thing to do]
### 6. If You Need to Transform
[Recommended transformation and when to use it vs. GLM vs. non-parametric]
Create a matplotlib visualization with 4 panels:
Save as a PNG file. Use plt.savefig() and plt.close() to avoid display issues.
After presenting the report, suggest what the user might want to do next:
The distribution reference ships with this skill at
reference/statistical-distributions.md (next to this SKILL.md).
It covers 12 distributions plus zero-inflated models, with detection heuristics, valid summary statistics, recommended tests, transformations, and A/B testing implications for each.
When to read it: After identifying the distribution in Step 3, read the specific card for that distribution to get detailed guidance. Don't load the entire file if you only need one card.
Sections:
reference/statistical-distributions.md) for detailed recommendations, not your own memoryWhat 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./archaeologyRetrieve proven SQL patterns, table cheatsheets, and join patterns from .knowledge/query-archaeology/ so past work gets reused. Fire as a pre-flight step before writing ANY SQL. Also trigger on "do we have a known query for X", "how do we usually join these tables", "have we computed this metric before". If the store is empty or missing, exit silently. Also owns the writer convention: after a validated analysis, curate the final SQL here./businessBrowse and search the organization's business context in .knowledge/organizations/: glossary terms, product catalog, metric definitions, OKRs, team structure. Trigger on "/business", "show me our glossary", "what metrics are defined?", "what products do we have?", "show me our OKRs", "who's on which team?", "look up [business term]", "what's the meaning of [term]?". Use this instead of reading the files directly./causalCausal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats. Invoke as /causal. Trigger on "causal", "caused", "impact of", "effect of", "attribution", "counterfactual", "difference-in-differences", "DiD", "propensity matching", "pre-post". If randomization IS possible, route to /experiment design instead.Other plugins' skills for the same job