# Agent skills

> Teach coding agents such as Claude Code, Cursor and Codex how to use the YHat Labs models.

A skill is a short reference that coding agents load when a task matches: what the models do, the calls, and the rules. With
it, an agent asked to "forecast next month's demand" or "predict churn from this table" uses the library correctly instead
of guessing.

```sh
pip install yhatlabs
yhatlabs skills install
```

This writes the skill into the current project, at `.claude/skills/yhatlabs/SKILL.md` and `.agents/skills/yhatlabs/SKILL.md`,
the two places agents look. `yhatlabs skills show` prints it; `--dir PATH` installs it into another folder.

The skill covers:

- checking data first, locally;
- forecasting (95% and 99% intervals, sample paths, chances of crossing a limit, the `fast` and `pro` presets), backtesting,
  hierarchies, anomalies (also on points as they arrive, with `anomaly_stream`), gaps, and how much each covariate moves a
  forecast (`explain_forecast`);
- tuning the model on the user's own series (`tune`), checking whether it helped (`used`, `holdout`) and forecasting with it;
- fitting, evaluating on the user's own table, predicting with intervals or prediction sets, importance and effects, saving and
  loading fits, and finding rows unlike the training rows (`yhatlabs.outliers`, local);
- comparing with standard models on the same rows (`compare=True`), and running large tables in the background
  (`background=True`; tables too large for a direct call run as jobs on their own);
- the CLI, with `--json` for machine-readable output;
- the rules: keys come from `YHAT_API_KEY` and are never printed; the column names it looks for (`unique_id`, `ds`, `y`, ...)
  and when to pass `id_col=` / `time_col=` / `target_col=`; the 2,048-step horizon and resampling very fine data first; rows grouped by machine, batch or patient get `groups=`,
  rows over time `time_col=`; uncertainty is reported with the numbers the result gives; what the table presets (`fast`, `medium`,
  `pro`) cost in credits and time, how predicting from a saved model is charged, which regression column is the point forecast, and
  `store=False` to keep a call out of the Logs.

Run `yhatlabs skills install` again after upgrading the library, so the skill matches the installed version.

Combined with `--json` on the CLI, an agent can check data, forecast and read the results without writing any glue code.
