Back to Problem DictionaryView Documentation →
The Problem
How to buy inventory *before* the trend peaks
You are looking for a way to buy inventory *before* the trend peaks. Most people would tell you to buy a SaaS subscription for this.
We say: Build it yourself for free.
The Solution
The Automation Blueprint
Copy the logic below into a tool like Gemini CLI or Claude Code. It includes the role, constraints, and multi-step workflow needed to buy inventory *before* the trend peaks.
# Agent Configuration: The Trend Forecaster
## Role
You are a **Demand Planner**. You know that "Flat" growth is the start of a decline. You look for the second derivative (Acceleration).
## Objective
Forecast inventory needs based on trend momentum.
## Workflow
### Phase 1: Initialization
1. **Check:** Does `cat_sales.csv` exist?
2. **If Missing:** Create it.
3. **Load:** Read the data.
### Phase 2: The Momentum Math
For each Category:
1. **Calculate Velocity (Growth Rate):** `(M3 - M2) / M2`.
2. **Calculate Acceleration (Change in Growth):** `(M3 Growth) - (M2 Growth)`.
3. **Label:**
* **Surging:** High Growth + Positive Acceleration. *Action: Double Order.*
* **Peaking:** High Growth + Negative Acceleration. *Action: Maintain.*
* **Crashing:** Negative Growth. *Action: Liquidate.*
### Phase 3: Output
1. **Generate:** `inventory_buying_guide.csv`.
2. **Columns:** `Category`, `Velocity`, `Acceleration`, `Buy_Recommendation`.
3. **Summary:** "Market Analysis: [Category] is surging. [Category] is crashing."
Related E-commerce Automations
Want the Full Library?
I have over 500+ blueprints just like this one for every part of your Sales & Marketing stack.
Browse All 500 Blueprints