feat: ship first-party timesfm-forecasting Agent Skill (agentskills.io)#368
feat: ship first-party timesfm-forecasting Agent Skill (agentskills.io)#368borealBytes wants to merge 3 commits intogoogle-research:masterfrom
Conversation
Add a self-contained AI agent skill for TimesFM that teaches coding agents (Claude Code, OpenCode, Cursor, Codex) how to use the TimesFM API correctly — safe model loading, zero-shot forecasting, covariate workflows, anomaly detection, and the most common pitfalls. Files added: - AGENTS.md — auto-loaded skill document (root of repo) - claude-skill/scripts/check_system.py — mandatory preflight RAM/GPU/disk checker - claude-skill/scripts/forecast_csv.py — CLI wrapper for CSV forecasting - claude-skill/references/ — ForecastConfig API ref, data prep, HW reqs - claude-skill/examples/global-temperature/ — basic forecast + PNG/GIF pipeline - claude-skill/examples/anomaly-detection/ — two-phase detrend+Z-score + quantile PI - claude-skill/examples/covariates-forecasting/ — forecast_with_covariates() XReg demo - .gitattributes — Git LFS rules for PNG/GIF binary outputs Contributed by Clayton Young / Superior Byte Works LLC (@borealBytes) Apache 2.0 — same license as this repository
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…ndard
Replace AGENTS.md / claude-skill/ with a proper agentskills.io-compliant
skill directory. Any AI agent that supports the open Agent Skills standard
(Claude Code, OpenCode, Cursor, Codex, etc.) can now install and use this
skill generically.
Changes:
- Remove AGENTS.md (was Claude-specific convention)
- Remove claude-skill/ directory (was Claude-specific naming)
- Add timesfm-forecasting/SKILL.md with compliant frontmatter:
name: timesfm-forecasting
description: ...
license: Apache-2.0
metadata: author, version
- Rename claude-skill/examples/ → timesfm-forecasting/examples/
- Rename claude-skill/scripts/ → timesfm-forecasting/scripts/
- Rename claude-skill/references/ → timesfm-forecasting/references/
- Update .gitattributes paths to match new directory
Skill installs via:
cp -r timesfm-forecasting/ ~/.claude/skills/
cp -r timesfm-forecasting/ ~/.cursor/skills/
# or any agent that supports agentskills.io
Spec: https://agentskills.io/specification
Short pointer for agents working directly in this repo. Points to timesfm-forecasting/SKILL.md and provides install commands for the first-party Agent Skill.
🌡️ Example 1 — Global Temperature Forecast📁 The baseline example. Loads 564 rows of NOAA global temperature anomaly data (2022–2024), runs a zero-shot 12-month forecast with TimesFM 1.0, and outputs a static visualization plus a 25-frame animated GIF showing how the forecast evolves as more historical context is added. 📊 Forecast Visualization🎬 Forecast Evolution Animation (25 frames)Each frame adds one month of context (12 → 36 months). Watch the forecast tighten as the model sees more of the warming trend. Key metrics
Run itcd timesfm-forecasting/examples/global-temperature
python run_forecast.py # → output/forecast_output.json
python visualize_forecast.py # → output/forecast_visualization.png
python generate_animation_data.py && python generate_gif.py # → output/forecast_animation.gif |
🔍 Example 2 — Anomaly Detection (Two-Phase Method)📁 TimesFM has no built-in anomaly detection, but its calibrated quantile intervals make it a natural fit. This example uses a two-phase approach combining classical detrending with TimesFM's prediction intervals. 📊 Anomaly Detection OutputHow it worksPhase 1 — Context (historical 36 months, 2022–2024):
Phase 2 — Forecast (12 months):
Results
Run itcd timesfm-forecasting/examples/anomaly-detection
python detect_anomalies.py
# → output/anomaly_detection.json
# → output/anomaly_detection.png |
📈 Example 3 — Covariates / XReg Forecasting📁 Demonstrates the 📊 Covariate Decomposition (2×2 layout, shared x-axis)Dataset
Output CSV: 108 rows (3 stores × 36 weeks = 24 context + 12 horizon) Covariate types used
Run itpip install timesfm[xreg]
cd timesfm-forecasting/examples/covariates-forecasting
python demo_covariates.py
# → output/sales_with_covariates.csv (108 rows)
# → output/covariates_data.png
# → output/covariates_metadata.json |
Why this PR exists — and why it mattersSaw Nic Borensztein's post a couple weeks back and it crystallized something I'd been thinking about:
That's exactly right. Without a skill, agents act sloppily — wrong API calls, wrong quantile indices, OOM crashes on first model load. The documentation exists, but agents don't read it the way humans do. A SKILL.md is the bridge. I'd just submitted a similar skill to K-Dense AI's scientific skills repo — currently the largest collection of research-focused agent skills I can find, covering 140+ scientific Python packages and databases. I was already building skills there (scientific writing standards, markdown/mermaid documentation pipelines), so TimesFM was a natural next addition. But a first-party skill belongs here, not just in a third-party library. The man page analogy is real. Early Linux shipped full documentation with every tool — There's also a security angle nobody talks about: if you don't ship your own skill, someone else will. Third-party skills carry no license provenance, no safety guarantees, no official boundaries for what agents should and shouldn't do with your API. First-party skills let you own that contract. This is me nudging things forward on free trials and leftover credits. Happy to do more — better skills, skill scaling patterns, security/deployment ideas — but I'm running on fumes. Open to a conversation, AI credits, or even just a PR merge or comment from the team. Either way, I hope this is useful. Take it and make it better. — Clayton Young / @borealBytes / Superior Byte Works |
85f57b1 to
1c959c8
Compare
|
Closing in favor of ##369 |




What this adds
A
timesfm-forecasting/directory — a compliant Agent Skill that teaches AI agents how to use the TimesFM API correctly.Agents that support the open Agent Skills standard (OpenCode, Cursor, Codex, and others) discover and install skills like this:
Once installed, the agent reads
SKILL.mdat startup and gets accurate, production-ready knowledge of the TimesFM API — correct quantile indices, mandatory system check before model load, fullForecastConfigreference — before writing a single line of code.Structure
AGENTS.mdat repo root is a lightweight entry point for agents working directly in this repo (points to the skill and provides install instructions).SKILL.md covers
ForecastConfigparameter reference with "when to change" guidanceNo existing files modified
Everything lives under
timesfm-forecasting/andAGENTS.md. The existingsrc/,v1/,notebooks/, andREADME.mdare untouched.Testing
All three examples verified (see comments below for output images):
examples/global-temperature/point_forecasthas 12 values; PNG shows context + forecast + PI bands; GIF animates 25 framesexamples/anomaly-detection/examples/covariates-forecasting/Regression commands in
SKILL.mdunder Validation & Verification.CLA