Skip to main content
ClaudeWave
Skill209 estrellas del repoactualizado 7d ago

algo-forecast-prophet

Build forecasting models with Meta's Prophet for business time series with holidays and changepoints. Use this skill when the user needs user-friendly time series forecasting, handling of missing data and holidays, or automatic changepoint detection — even if they say 'forecast with Prophet', 'business forecast', or 'easy time series model'.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/asgard-ai-platform/skills /tmp/algo-forecast-prophet && cp -r /tmp/algo-forecast-prophet/algo-forecast-prophet ~/.claude/skills/algo-forecast-prophet
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Prophet Forecasting

## Overview

Prophet (Meta) decomposes time series into trend + seasonality + holidays + error. Uses an additive (or multiplicative) model fitted with Stan. Handles missing data, outliers, and holiday effects natively. Designed for business time series at daily/weekly granularity.

## When to Use

**Trigger conditions:**
- Forecasting business metrics (sales, traffic, engagement) at daily/weekly frequency
- Data with strong seasonal patterns and known holiday effects
- Need quick, reasonable forecasts without deep time series expertise

**When NOT to use:**
- For high-frequency data (sub-hourly) — Prophet is designed for daily+
- When you need causal/explanatory models (Prophet is descriptive)
- For very short time series (< 2 seasonal cycles)

## Algorithm

```
IRON LAW: Prophet Is an Additive Regression Model, NOT Classical Time Series
y(t) = g(t) + s(t) + h(t) + ε(t)
- g(t): piecewise linear or logistic trend with automatic changepoints
- s(t): Fourier series for yearly/weekly/daily seasonality
- h(t): user-specified holiday effects
Prophet does NOT model autocorrelation in residuals. If residuals are
autocorrelated, the uncertainty intervals will be too narrow.
```

### Phase 1: Input Validation
Prepare DataFrame with columns: ds (datestamp), y (metric). Add regressor columns if available. Specify: country holidays, custom holidays, growth type.
**Gate:** Data formatted, minimum 2 full seasonal cycles.

### Phase 2: Core Algorithm
1. Choose growth model: 'linear' (default) or 'logistic' (with cap and floor)
2. Set seasonality: yearly (default), weekly (default), custom (e.g., monthly)
3. Add holidays: country built-ins + custom events (promotions, launches)
4. Fit model: `m = Prophet(); m.fit(df)`
5. Generate future DataFrame and predict: `m.predict(future)`

### Phase 3: Verification
Check: forecast components (trend, seasonality, holidays) are intuitive. Cross-validate: use Prophet's built-in `cross_validation()` with rolling windows. Evaluate MAPE, RMSE.
**Gate:** MAPE acceptable for use case, components pass visual inspection.

### Phase 4: Output
Return forecast with decomposed components.

## Output Format

```json
{
  "forecasts": [{"ds": "2025-04-15", "yhat": 1200, "yhat_lower": 1050, "yhat_upper": 1350}],
  "components": {"trend": "upward_3pct", "yearly_seasonality": "peak_in_december", "weekly_seasonality": "low_on_weekends"},
  "metadata": {"mape": 0.08, "training_days": 730, "forecast_days": 90}
}
```

## Examples

### Sample I/O
**Input:** 2 years of daily website traffic with Christmas spike and summer dip
**Expected:** Forecast captures: upward trend, weekly pattern (weekday > weekend), annual pattern (Christmas spike, summer dip).

### Edge Cases
| Input | Expected | Why |
|-------|----------|-----|
| Many missing days | Prophet handles natively | Unlike ARIMA, no imputation needed |
| Sudden trend change | Changepoint detected automatically | Prophet's key feature vs ARIMA |
| Multiplicative seasonality | Set seasonality_mode='multiplicative' | When seasonal amplitude grows with trend |

## Gotchas

- **Default changepoint sensitivity**: Prophet may over/under-detect trend changes. Tune `changepoint_prior_scale` (default 0.05): higher = more flexible, lower = smoother.
- **Flat forecasts**: If trend changepoints are too conservative, long-range forecasts can be unrealistically flat. Increase flexibility or specify growth cap.
- **Holiday effects require specification**: Prophet doesn't discover holidays automatically. You must provide a holiday DataFrame — missing holidays will not be modeled.
- **Not for causal inference**: Prophet finds patterns but doesn't explain why. Adding a regressor shows correlation, not causation.
- **Uncertainty intervals**: Based on historical trend change variance, not residual autocorrelation. May be too narrow if residuals are structured.

## References

- For Prophet hyperparameter tuning guide, see `references/prophet-tuning.md`
- For cross-validation best practices, see `references/prophet-cv.md`
algo-ad-biddingSkill

Implement and select ad bidding strategies from manual CPC to automated target-CPA and target-ROAS. Use this skill when the user needs to choose a bidding strategy, set up automated bidding, or optimize bid parameters — even if they say 'what bidding strategy should I use', 'target CPA setup', or 'smart bidding configuration'.

algo-ad-budgetSkill

Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to distribute budget across multiple campaigns, optimize spend pacing, or maximize overall ROAS under budget constraints — even if they say 'how to split my ad budget', 'campaign budget optimization', or 'diminishing returns on ad spend'.

algo-ad-ctrSkill

Build CTR prediction models for estimating ad click-through rates from features. Use this skill when the user needs to predict click probability, build an ad ranking model, or evaluate ad creative performance — even if they say 'predict click rate', 'ad relevance scoring', or 'which ad will get more clicks'.

algo-ad-gspSkill

Implement Generalized Second Price auction for ad slot allocation and pricing. Use this skill when the user needs to understand search ad auctions, compute ad positions and costs-per-click, or analyze bidding dynamics — even if they say 'how does Google Ads auction work', 'ad rank calculation', or 'second price auction for ads'.

algo-ad-vcgSkill

Implement VCG mechanism for incentive-compatible ad slot allocation with truthful bidding. Use this skill when the user needs to design a truthful auction mechanism, compute externality-based payments, or understand why platforms may prefer GSP over VCG — even if they say 'truthful auction design', 'VCG payments', or 'incentive-compatible mechanism'.

algo-blockchain-basicsSkill

Explain blockchain fundamentals including distributed ledger architecture, consensus mechanisms, and block structure. Use this skill when the user needs to understand blockchain concepts, evaluate whether blockchain fits a use case, or design a blockchain-based solution — even if they say 'how does blockchain work', 'do I need blockchain', or 'distributed ledger'.

algo-blockchain-smart-contractSkill

Design and implement smart contracts as self-executing programmatic agreements on blockchain. Use this skill when the user needs to build automated on-chain logic, evaluate smart contract security, or design tokenized business rules — even if they say 'smart contract development', 'automated agreement', or 'on-chain logic'.

algo-ecom-bm25Skill

Implement BM25 ranking function for e-commerce product search relevance scoring. Use this skill when the user needs to build a text-based product search engine, improve search result relevance, or replace basic TF-IDF with a more robust ranking function — even if they say 'product search ranking', 'search relevance', or 'BM25 implementation'.