Evo Ecommerce Anomaly logo

Evo Ecommerce Anomaly

Community
Zhang-Henry
evo-ecommerce-anomaly

Reusable pipeline for detecting anomalous product category sales patterns in e-commerce transaction data and identifying demographic drivers via Difference-in-Differences causal analysis. Handles data cleaning, counterfactual forecasting, feature engineering, and DiD estimation.

Overview

PublisherZhang-Henry
RepositoryCoEvoSkills
Skill nameevo-ecommerce-anomaly
Stars
83
Forks
9
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Zhang-Henry on GitHub. Read the source before you install it.

Installation

Install the Evo Ecommerce Anomaly AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Zhang-Henry/CoEvoSkills/tree/main/artifacts/skills/trend-anomaly-causal-inference/evo-ecommerce-anomaly
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Zhang-Henry/CoEvoSkills.git /tmp/CoEvoSkills
mkdir -p .claude/skills
cp -r /tmp/CoEvoSkills/artifacts/skills/trend-anomaly-causal-inference/evo-ecommerce-anomaly .claude/skills/evo-ecommerce-anomaly
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Evo Ecommerce Anomaly in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Evo Ecommerce Anomaly on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Evo Ecommerce Anomaly is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

E-Commerce Anomaly Detection and Causal Analysis

Overview

Generic pipeline for analyzing e-commerce transaction anomalies and their demographic drivers:

  1. Data cleaning: Removes duplicates, auto-detects and fixes dirty categorical values, fills missing values with mode
  2. Anomaly detection: Counterfactual forecasting using day-of-week averages with linear trend; anomaly index scaled to [-100, 100]
  3. Feature engineering: Runtime discovery of ordinal scales, binary indicators, multi-select decomposition, and one-hot encoding
  4. DiD causal analysis: Univariate DiD for intensive margin (spend) and extensive margin (purchase probability)

End-to-End Usage

The caller supplies file paths and period boundaries from the task instruction.

python
import sys, os, json
sys.path.insert(0, '/app/environment/skills/evo-ecommerce-anomaly/scripts')

from data_cleaning import clean_survey, clean_purchases
from anomaly_detection import compute_anomaly_index
from feature_engineering import engineer_survey_features
from causal_analysis import run_full_causal_analysis

# --- Caller supplies these from the task instruction ---
survey_path = '<SURVEY_CSV_PATH>'          # path to dirty survey CSV
purchase_path = '<PURCHASE_CSV_PATH>'      # path to dirty purchase CSV
output_dir = '<OUTPUT_DIR>'                # where to write results
treatment_start = '<YYYY-MM-DD>'           # start of event/treatment window
treatment_end = '<YYYY-MM-DD>'             # end of event/treatment window
baseline_start = '<YYYY-MM-DD>'            # start of baseline comparison window
baseline_end = '<YYYY-MM-DD>'              # end of baseline comparison window
# -------------------------------------------------------

os.makedirs(output_dir, exist_ok=True)

# Step 1: Clean data
survey_clean = clean_survey(survey_path)
survey_clean.to_csv(f'{output_dir}/survey_cleaned.csv', index=False)

purchases_clean = clean_purchases(purchase_path)
purch_save = purchases_clean.drop(columns=['Total_Spend'], errors='ignore')
date_col = [c for c in purch_save.columns if 'date' in c.lower()][0]
purch_save[date_col] = purch_save[date_col].dt.strftime('%Y-%m-%d')
purch_save.to_csv(f'{output_dir}/purchases_filtered.csv', index=False)

# Step 2: Feature engineering
survey_features = engineer_survey_features(survey_clean)
survey_features.to_csv(f'{output_dir}/survey_feature_engineered.csv', index=False)

# Step 3: Anomaly detection
anomaly_df = compute_anomaly_index(
    purchases_clean, treatment_start=treatment_start, treatment_end=treatment_end
)
anomaly_df.to_csv(f'{output_dir}/category_anomaly_index.csv', index=False)

# Step 4: Causal analysis
id_col = survey_features.columns[0]
report, intensive_df, extensive_df = run_full_causal_analysis(
    purchases_clean, survey_features, anomaly_df,
    baseline_start=baseline_start, baseline_end=baseline_end,
    treatment_start=treatment_start, treatment_end=treatment_end,
    id_col=id_col
)
intensive_df.to_csv(f'{output_dir}/intensive_margin.csv', index=False)
cat_col = [c for c in extensive_df.columns if 'category' in c.lower()]
cat_col = cat_col[0] if cat_col else 'Category'
extensive_df = extensive_df[[id_col, cat_col, 'Period', 'Has_Purchase']]
extensive_df.to_csv(f'{output_dir}/extensive_margin.csv', index=False)
with open(f'{output_dir}/causal_analysis_report.json', 'w') as f:
    json.dump(report, f, indent=2)

Scripts

  • scripts/data_cleaning.py - clean_survey(path), clean_purchases(path): Auto-detects column types and dirty values
  • scripts/anomaly_detection.py - compute_anomaly_index(df, treatment_start, ...): All dates are required caller params
  • scripts/feature_engineering.py - engineer_survey_features(df): Runtime ordinal/categorical discovery
  • scripts/causal_analysis.py - run_full_causal_analysis(...): All period boundaries required, columns auto-detected

Design Principles

  • No hardcoded dates, file paths, column names, or instance-specific values
  • All period boundaries are required caller parameters (no defaults)
  • Feature engineering discovers column types and ordinal orderings at runtime from data distributions
  • Data cleaning detects dirty values by comparing text vs numeric value distributions within columns
  • Column names are auto-detected from data when not explicitly provided
  • Anomaly index uses max-abs normalization of deviation ratios for [-100, 100] scale
  • DiD uses univariate approach per feature to avoid multicollinearity with many features

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Evo Ecommerce Anomaly AI skill do?

Reusable pipeline for detecting anomalous product category sales patterns in e-commerce transaction data and identifying demographic drivers via Difference-in-Differences causal analysis. Handles data cleaning, counterfactual forecasting, feature engineering, and DiD estimation.

Why use Evo Ecommerce Anomaly on TypingMind?

Because you install it once and use it with any model. Evo Ecommerce Anomaly is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Evo Ecommerce Anomaly in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Zhang-Henry/CoEvoSkills/tree/main/artifacts/skills/trend-anomaly-causal-inference/evo-ecommerce-anomaly. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Evo Ecommerce Anomaly?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Evo Ecommerce Anomaly?

As many as you like. As long as a model supports skills, you can use Evo Ecommerce Anomaly with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Evo Ecommerce Anomaly AI skill free?

Yes. It is published on GitHub by Zhang-Henry under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇