# Retail Sellout Analytics

> Clean messy retail spreadsheets and generate store clusters, sales forecasts, and stock-risk reports using Python.

Retail Sellout Analytics is a free AI agent skill on Agensi by Hudaif. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Hudaif](https://www.agensi.io/creators/hudaif)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/retail-sellout-analytics
- Tags: research-analysis, python, retail-analytics, forecasting, inventory-management

## About this skill

Retail sell-out data is often trapped in messy, unformatted Excel sheets with merged cells, subtotal rows, and inconsistent column headers. This skill provides a Python-based pipeline to clean raw weekly sales files and generate predictive insights without leaving your environment.

### What it does
- **Data cleaning** automates the removal of subtotal rows, handles merged cells, and converts wide-format spreadsheets into tidy long-format CSVs.
- **Store clustering** segments retail outlets into profiles like Fast Movers or Declining/Overstocked using k-means based on growth, stock cover, and target achievement.
- **Demand forecasting** selects the best-performing model from Naive, Moving Average, or Holt’s Trend based on backtested MAPE for future weekly sales.
- **Stock risk analysis** scores inventory health from 0-6 to identify high-risk positions needing markdowns or transfers.
- **Automated reporting** synthesizes all CSV outputs into a Markdown management report covering category performance and inventory suggested actions.

### How it works
1. **Inspect** the raw file to identify store, category, week, and sales columns.
2. **Clean** the data using `clean_data.py` to produce a validated `clean_sales.csv`.
3. **Analyze** by running the full pipeline or individual scripts for clustering, forecasting, and stock risk.
4. **Review** the `report.md` and `data_quality.txt` to verify totals and interpret the business findings.

### Frameworks & tools
Python 3.9+, Pandas, NumPy, Scikit-learn, and Openpyxl.

### Why this beats prompting it yourself
Prompting an LLM to "analyze sales" often leads to hallucinated totals or shallow summaries. This skill uses verifiable Python logic to calculate stock-turn, backtest forecasts, and cap outliers at the 95th percentile, ensuring the math is reproducible and the data is ready for BI tools.

### Use cases
- Auditing weekly retail performance across hundreds of mall locations.
- Identifying overstocked categories for end-of-season markdown planning.
- Generating a 6-week sales forecast for supply chain replenishment.
- Segmenting stores by volume and growth to tailor local marketing efforts.

### Known limitations
Requires at least 6 stores for clustering and 7 weeks of history for forecasting. Does not support network-based API calls or external data enrichment.

## Requires

- Python

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Retail Sellout Analytics skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Which AI agents or platforms are compatible with this skill?

The skill is a Python-based pipeline designed for any AI agent with a code execution environment. It works seamlessly with ChatGPT (Advanced Data Analysis), Claude (Analysis Tool), or local agents running Python 3.9+.

### How does this handle spreadsheets with merged cells or irregular headers?

This skill specifically targets the 'messy' data common in retail, such as merged cells, subtotal rows, and non-standard layouts. It uses hard-coded logic to restructure these into tidy formats, preventing the hallucinations often seen when asking an LLM to clean data manually.

### What exactly is included in the download package?

You will receive a suite of modular Python scripts (including data cleaning, clustering, and forecasting modules), a documentation guide, and a sample template to ensure your raw retail data maps correctly to the pipeline.

### Is there a minimum amount of data required for the analytics to work?

The clustering and forecasting engines require a baseline of data to ensure statistical significance: a minimum of 6 unique store locations and at least 7 weeks of historical sales data are needed to generate reliable results.

### Does this skill require any external API connections or internet access to function?

No, this skill is designed for privacy and speed; it processes all data locally within your agent's environment. It does not require external API keys or cloud connections to perform the clustering or forecasting.

### How does the skill determine which forecasting model to use for my sales data?

Yes, the forecasting module automatically backtests multiple models (Naive, Moving Average, and Holt’s Trend) and selects the one with the lowest Mean Absolute Percentage Error (MAPE) specifically for your dataset.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
