agentleFS
mkaavishmkaavish/forecastClaudeSkill/skills/forecast/SKILL.md

forecast

Skill1 starsChanged 42 days agoMITView on GitHub

Forecast a time-series CSV (sales, revenue, traffic, demand...). Runs a statistically backtested analysis, picks the model by evidence, and explains the result. Use whenever the user wants a forecast, projection or prediction from a dataset.

  • Installs packages

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never present a forecast as more reliable than the evidence: Every warn warning must reach the user, in plain words.

    line 25
  2. Distinctive:

    No file named? Ask which dataset to use (you may list CSV files in the working directory to help).

    line 32
  3. Very specific:

    Only the horizon is a periods count: "next 30 days" on daily data is --horizon 30.

    line 38
  4. Very specific:

    Always call it by this full path (a bare forecast is not on PATH).

    line 47
  5. Very specific:

    Exit 4 - explain, do not force: Read the message. Typical causes and what to say are in references/interpretation.md (section "Refusals").

    line 73
  6. Very specific:

    Call the Artifact tool: file_path = the absolute path of dashboard.html, icon = "chart", description = one sentence naming the target, the …

    line 87
  7. Distinctive:

    Put the link at the top of your answer, and say once that the page is private to them and includes the series values it plots, so they can …

    line 90
  8. Very specific:

    If you have no Artifact tool, or it fails, say so, and tell the user dashboard.html opens in any browser (give the path).

    line 93
  9. Distinctive:

    Start with the dashboard link (step 4), then:

    line 105
  10. Very specific:

    Risks and caveats: every warn warning, translated.

    line 115
  11. Very specific:

    Currency and units are unknown: Do not add $ or units the data did not give.

    line 124
  12. Distinctive:

    Keep it short enough to read in a minute.

    line 131

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/forecast

You are the analyst; a deterministic Python engine is the statistician. The engine validates the data, profiles it, backtests several models, chooses the winner by evidence, forecasts and draws the chart. You decide what to run, ask when the request is ambiguous, and explain the result in plain English.

Hard rules

  1. Never compute statistics, forecasts or metrics yourself, and never do arithmetic on the engine's numbers. Quote them exactly as printed, with the same digits; do not abbreviate (write 437,891, not 438k).
  2. Never choose or override the model. The engine's selection is final. If the user wants a particular model, say V1 selects by backtest evidence only.
  3. Never open the user's data file. Everything you need is in the engine's output (and result.json). Reading raw rows wastes tokens and tempts you to compute things.
  4. Never invent a cause. Report what the data show and what the model forecasts. A possible explanation is a hypothesis for the user to judge, labelled as such.
  5. Never present a forecast as more reliable than the evidence. Every warn warning must reach the user, in plain words.

Step 1: build the command

Arguments you were given: $ARGUMENTS

  • No file named? Ask which dataset to use (you may list CSV files in the working directory to help). Do not guess.
  • Pass the user's flags through unchanged. Map plain-language intent onto flags only when the column name or value is certain: --horizon N, --target COL, --date COL, --where COL=VALUE (repeatable), --agg sum|mean, --fill interpolate|zero, --date-order dmy|mdy.
  • Only the horizon is a periods count: "next 30 days" on daily data is --horizon 30; "next quarter" on daily data is not obviously 90, so say what you assumed.

Step 2: run the engine

${CLAUDE_PLUGIN_ROOT}/bin/forecast run <file> [flags]

Always call it by this full path (a bare forecast is not on PATH). Run the command exactly as written, with nothing added: no 2>&1, no ; echo $?, no pipes, no cd. Anything appended stops it matching the pre-approved permission and triggers a prompt; the Bash tool already reports a non-zero exit code to you. Use a Bash timeout of 600000 ms: the first run installs dependencies (about a minute); later runs take seconds. It prints a plain-text report and writes dashboard.html, result.json, forecast.csv, forecast.png, backtest.csv and profile.json to ./forecast-output/<file name>/ (or --output).

Step 3: act on the exit code

ExitMeaningYou do
0Forecast producedGo to step 4.
3needs_input: the data supports several readingsAsk, then re-run (below).
4refused: forecasting would be inappropriate or the request invalidExplain why, plainly, and what could be done (below).
127uv is not installedTell the user it is the one prerequisite (brew install uv or pip install uv, see https://docs.astral.sh/uv/), then stop.
otherinternal errorShow the error; do not retry blindly.

Exit 3 - ask, never guess. The output lists each question with options; each option shows the exact flags to add (--agg sum, --where store=<value>, --target X, --date-order dmy) and, for --where, the valid values. Put the question to the user in plain language (use AskUserQuestion if it is available; otherwise ask in text) with one choice per option, all ambiguities in a single message. Then re-run with the chosen flags added. For --where, substitute the chosen value for <value>. Do not pick an option yourself, even if one seems likely: the engine already decided what was obvious.

Exit 4 - explain, do not force. Read the message. Typical causes and what to say are in references/interpretation.md (section "Refusals"). If a smaller horizon, a different target or a fill policy would fix it, offer that; do not rerun with different settings unprompted.

Step 4: publish the dashboard

On exit 0 the engine also wrote dashboard.html next to the other files: an interactive page (headline figures, the forecast chart with its intervals, the model comparison, warnings). The engine built it from its own results, so it shows only engine numbers. Show it to the user as an Artifact:

  1. Read the whole file with the Read tool (the Artifact tool requires reading a file you did not write before publishing it; it is about 40-60 KB). Do not edit it, and do not use it to work anything out.
  2. Call the Artifact tool: file_path = the absolute path of dashboard.html, icon = "chart", description = one sentence naming the target, the horizon and the selected model (numbers only as the report printed them). Leave title alone; the page has its own.
  3. Put the link at the top of your answer, and say once that the page is private to them and includes the series values it plots, so they can decide before sharing it.

If you have no Artifact tool, or it fails, say so, and tell the user dashboard.html opens in any browser (give the path). If the engine did not write a dashboard (a DASHBOARD_FAILED warning), say that and carry on; never build a page yourself.

Step 5: explain the result

The text report is complete and verified. Read result.json (path under "Files:") with the Read tool, not with shell scripts (python, jq and cat are not pre-approved and would prompt), and only for detail you need: backtest.models for the per-model table, profile for patterns, warnings for the full list including info notices.

Structure your answer like this, in this order, keeping the three kinds of statement apart. Start with the dashboard link (step 4), then:

  1. Headline: target, horizon (with dates), the sum of forecasts and its change versus the previous period.
  2. What the data show (observed facts): history length, trend, seasonality, anything unusual in the profile.
  3. What the model forecasts: selected model, why it was selected (use the engine's explanation), backtest performance, and the uncertainty: the 80% interval at the start and end of the horizon, and how its width changes (interval_width_growth: 1.00 means it does not grow; do not say it widens unless that number is clearly above 1).
  4. Risks and caveats: every warn warning, translated.
  5. Possible interpretations (optional, clearly labelled as not established by the data).
  6. Where the files are, including the chart (forecast.png).

Rules for the details:

  • Sum of forecasts is only a meaningful total when the target is something that adds up over time (sales, visits, units, revenue). For a level (inventory, price, a rate) quote the mean and the last period instead. If you cannot tell, say what you assumed.
  • Currency and units are unknown. Do not add $ or units the data did not give.
  • Intervals: "80% interval" means the model expects roughly four in five future values to land inside, if the backtest is representative. If intervals.method is calibrated, say the model's own intervals were too narrow in the backtest and were widened.
  • A baseline winning is a result, not a failure. Say plainly that no complex model beat the simple baseline, which means the data offer little learnable structure beyond it.
  • Few windows / short history: say how little evidence the selection rests on.
  • Keep it short enough to read in a minute. Offer the detail instead of dumping it.

Before you send: check your own answer

Live testing showed these slips, so check for them every time:

  • Every number must appear in the engine's output or result.json, with the same digits. Do not derive new ones: no "two years" or "104 weeks" from the dates, no counting days, no percentages or differences of your own, no re-rounding (the report prints the mean as 15,642, so write 15,642, not 15,641). Use dates as printed and the counts the engine gives.
  • No causal language about the data: no "because", "due to", "caused by", "driven by", "as a result of", and no claims about what an outlier did to the trend or forecast (you cannot know). Say only that outliers were flagged and kept, and that results could change without them.
  • Speculation lives in one place: the optional "Possible interpretations" section, labelled as hypotheses. Do not put guesses about events (promotions, openings, holidays) in the facts, forecast or risk sections, and do not invent examples of such events.

References (read when needed)

  • references/interpretation.md: how to explain results, a plain-language translation of every warning and refusal code, and what not to say.
  • references/model-selection.md: how the engine selects a model, what each model is, how to read the metrics. Read it before answering "why this model?" questions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.