# Analyzing Time Series

Comprehensive diagnostic analysis of time series data.

- Repository: https://github.com/datawhalechina/agent-skills-with-anthropic (1565 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-08-27
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add datawhalechina/agent-skills-with-anthropic --skill analyzing-time-series -g -a claude-code -y`
Codex: `npx skills add datawhalechina/agent-skills-with-anthropic --skill analyzing-time-series -g -a codex -y`
Cursor: `npx skills add datawhalechina/agent-skills-with-anthropic --skill analyzing-time-series -g -a cursor -y`
Gemini CLI: `npx skills add datawhalechina/agent-skills-with-anthropic --skill analyzing-time-series -g -a gemini-cli -y`

## Description

Comprehensive diagnostic analysis of time series data. Use when users provide CSV time series data and want to understand its characteristics before forecasting - stationarity, seasonality, trend, forecastability, and transform recommendations.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Time Series Diagnostics

Comprehensive diagnostic toolkit to analyze time series data characteristics before forecasting.

## Input Format

The input CSV file should have two columns:
- **Date column** - Timestamps or dates (e.g., `date`, `timestamp`, `time`)
- **Value column** - Numeric values to analyze (e.g., `value`, `sales`, `temperature`)


## Workflow

**Step 1: Run diagnostics**

```bash
python scripts/diagnose.py data.csv --output-dir results/
```

This runs all statistical tests and analyses. Outputs `diagnostics.json` with all metrics and `summary.txt` with human-readable findings. Column names are auto-detected, or can be specified with `--date-col` and `--value-col` options.

**Step 2: Generate plots (optional)**

```bash
python scripts/visualize.py data.csv --output-dir results/
```

Creates diagnostic plots in `results/plots/` for visual inspection. Run after `diagnose.py` to ensure ACF/PACF plots are synchronized with stationarity results. Column names are auto-detected, or can be specified with `--date-col` and `--value-col` options.

**Step 3: Report to user**

Summarize findings from `summary.txt` and present relevant plots. See `references/interpretation.md` for guidance on:
- Is the data forecastable?
- Is it stationary? How much differencing is needed?
- Is there seasonality? What period?
- Is there a trend? What direction?
- Is a transform needed?

## Script Options

Both scripts accept:
- `--date-col NAME` - Date column (auto-detected if omitted)
- `--value-col NAME` - Value column (auto-detected if omitted)
- `--output-dir PATH` - Output directory (default: `diagnostics/`)
- `--seasonal-period N` - Seasonal period (auto-detected if omitted)

## Output Files

The rest: https://github.com/datawhalechina/agent-skills-with-anthropic/blob/HEAD/6.Creating Custom Skills（自定义skills）/analyzing-time-series/SKILL.md
