Forecast sales (ets_holdout.py), predict outcomes or cluster customers, each judged against a simple baseline on held-out data with leakage checks. Not for RFM, Pareto or cohort tables; use customer-analytics.
Ships in data-analytics. 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.
Every model must beat a simple baseline on unseen data without leaking target or future information. Section 1 covers supervised prediction, section 2 customer clustering and section 3 time-series forecasts.
gateway(op="call", capability="data", args={op: "stats", path: "<file>", ...}) first (op: "stats" for types, nulls, ranges and date span; add group_by: [target] for class balance); use pandas, scikit-learn and statsmodels for modelling.random_state on every split and estimator, and re-run notebooks top to bottom (uv run jupyter nbconvert --to notebook --execute <notebook.ipynb> --output-dir out) before quoting final numbers.train_test_split(..., test_size=0.2, random_state=42), stratify=y for classification, chronological split for future periods); report train/test rows and class balance. Fit Pipeline + ColumnTransformer (OneHotEncoder(handle_unknown="ignore"), SimpleImputer, StandardScaler) on training data only; never tune repeatedly on test.DummyRegressor(strategy="mean") ("median" when skewed) with test MAE (and RMSE if relevant). Classification: DummyClassifier(strategy="most_frequent") plus a one-line domain rule (for example Discount > 0.2) with accuracy, precision and recall for the positive class. Show baselines and model side by side with train and test labelled; the model adds value only if it clearly beats baselines on test.max_depth=3, export_text) as rules; treat linear coefficients as conditional associations per unit.leakage, leaving [] when clean; a rerun with the same model, target and features replaces its row; names and numbers only, no data rows):import hashlib, json, os, pathlib
from datetime import datetime, timezone
run = {
"model": type(model[-1]).__name__, # the Pipeline's estimator
"target": "Profit",
"features": list(X_train.columns),
"split": "80/20, random_state=42",
"metric": {"name": "MAE", "value": float(test_mae), "better": "lower"}, # "higher" for accuracy, recall, R^2
"baseline": {"name": "mean", "value": float(baseline_mae)},
"leakage": [],
}
if os.environ.get("PANCODE_BOARD_FACTS"): # set only for commands a PanCode session runs
key = hashlib.sha1(json.dumps([run["model"], run["target"], sorted(run["features"])]).encode()).hexdigest()[:10]
fact = {"schema": "pancode.board.fact/v1", "kind": "experiment", "id": f"{run['model'][:40]}-{key}",
"at": datetime.now(timezone.utc).isoformat(timespec="seconds"), "experiment": run}
folder = pathlib.Path(os.environ["PANCODE_BOARD_FACTS"])
folder.mkdir(parents=True, exist_ok=True)
(folder / "experiment.tmp").write_text(json.dumps(fact), encoding="utf-8")
(folder / "experiment.tmp").replace(folder / f"experiment-{fact['id']}.json")
nunique of order IDs, verified against line count on one customer), Monetary (total sales; keep profit for profiling unless justified as input). Verify row count equals distinct customer IDs and Monetary and order totals reconcile.StandardScaler (after np.log1p on right-skewed nonnegative columns; state whether used) so currency does not swamp order counts. Fit KMeans(n_clusters=k, n_init=10, random_state=42) for k = 2..8, print and plot inertia (elbow) and silhouette_score, and when they disagree profile candidates to pick the smallest distinct, actionable k (never from one metric).adjusted_rand_score against the reference fit; if low or profiles drift, report it and revise k or features before interpreting.Grain and calendar. State the date column, additive measure (counts, sales or profit; not percentages, prices or balances), frequency (MS) and holdout (default 12 months). An absent month is unknown, never zero; confirm before --exclude-incomplete-edges (a CSV alone cannot prove completeness); keep at least 24 training months before the holdout.
Run the bundled script from the project folder, writing outputs only under out/:
uv run python <base_dir>/scripts/ets_holdout.py data/orders.csv \
--date-col "Order Date" --value-col Sales --holdout 12 --horizon 12 \
--plot out/ts_forecast.png --decomp-plot out/ts_decomposition.png
Smoothing, seasonality, trend. Summarize 3- and 12-month moving averages, repeating peak/trough months, seasonal strength, and OLS slope (units/month), R^2 and p-value (a significant slope with modest R^2 means seasonality drives most variance).
Judge the holdout. Compare seasonal naive (same month a year earlier), linear trend on training months, and Holt-Winters/ETS (12-month seasonality, 95% prediction intervals; --seasonal auto picks by training AICc only) on the same holdout. Report MAE, MAPE, bias (mean signed error), ETS 95% coverage and the month-by-month table. Losing to seasonal naive is valid; never fit, choose or tune on the holdout.
Interpret. Present the forward forecast only with its 95% interval and total range, naming the worst holdout miss month and visible factor, outside factors the series cannot see (pricing, promotions, supply, macro shifts), and whether beating seasonal naive justifies changing a decision.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/data-analytics:modellingfrom data-analytics
npx claudepluginhub panstudio/pancode --plugin data-analytics9 skills in this plugin
/analysis-projectStart a pinned uv analysis project or check one is ready (check_workspace.py), then lay out its notebook and prompt appendix. Read-only check; syncs only with the user's go. Not for the analysis itself; use pandas-descriptive./chartsMake and check bar, line, histogram or scatter charts (plotly_chart.py, matplotlib): backing table printed, sorted, labelled, bars from zero. Not for dashboards; use streamlit-app./customer-analyticsCohort retention, top-customer share and RFM (cohort_table.py, pareto_rfm.py) for repeat and best customers, counting customers and orders, not lines. Not for k-means clusters; use modelling./excelTurn spreadsheet work into Python: VLOOKUP, SUMIFS and pivot tables to pandas, .xlsx read and write, with merged-header, text-number and total traps. Not for Tableau exports; use tableau./grain-checkCheck messy rows and double counts before totals (grain_report.py): row meaning, cancellations, negative quantities, missing IDs, duplicates. Not for Tableau exports; use tableau./pandas-descriptiveSummary tables by group: total sales, profit margin, share of total, average order and pivots, each checked against the grand total. Not for models or segments; use modelling or customer-analytics.