Agent skill

Ecom Rfm Analysis

by asgard-ai-platform in asgard-ai-platform/skills

Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data.

MITAuto-check passed

Install Ecom Rfm Analysis

skills CLI
$ npx skills add asgard-ai-platform/skills --skill ecom-rfm-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install asgard-ai-platform/skills ecom-rfm-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/asgard-ai-platform/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ecom-rfm-analysis .claude/skills/ecom-rfm-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ecom-rfm-analysis
GitHub stars
242
Token cost
~1.3k tokens
SKILL.md length
459 words
Files
5 (incl. scripts, references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data.

  • Works in 3 steps: For each dimension, rank all customers… → Score 5 (best) to 1 (worst): R=5 means… → Combine into 3-digit RFM score (e.g.,…
  • The user needs to segment customers by purchase behavior
  • SKILL.md covers Overview, Framework, Output Format and Gotchas, plus 2 more sections
  • Runs Python scripts from its folder; calls python

What it does

Ecom Rfm Analysis is an agent skill from asgard-ai-platform/skills. Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data. Use this skill when the user needs to segment customers by purchase behavior, identify high-value buyers, design retention campaigns, or prioritize marketing spend by customer value — even if they say 'who are our best customers', 'which customers are at risk of churning', or 'how do we target our marketing'.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `examples/sample_input.json`, `references/clv-prediction.md` and `references/rfm-implementation.md`).

The repository describes itself as: 301 open-source coding agent skills across 22 domains — methodology, judgment & gotchas packaged as Claude Agent Skills for the Asgard AI Platform. The licence is MIT.

When your agent uses it

  • The user needs to segment customers by purchase behavior
  • Identify high-value buyers
  • Design retention campaigns
  • Prioritize marketing spend by customer value — even if they say who are our best customers

Example prompts

  • “who are our best customers”
  • “which customers are at risk of churning”
  • “how do we target our marketing”
  • “/ecom-rfm-analysis”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. For each dimension, rank all customers and divide into 5 equal groups (quintiles)
  2. Score 5 (best) to 1 (worst): R=5 means most recent, F=5 means most frequent, M=5 means highest spend
  3. Combine into 3-digit RFM score (e.g., R5-F4-M5 = recent, frequent, high-value)

What it can do on your machine

Read from SKILL.md and the folder at commit 4e7f4f8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ecom Rfm Analysis loads about 1.3k tokens when it runs, and up to ~7.8k if it reads all its reference files. Until then it costs about 104 tokens; SKILL.md has 459 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from asgard-ai-platform/skills at commit 4e7f4f8, republished under its MIT licence (© asgard-ai-platform). 459 words, ~1,342 tokens.

Download SKILL.mdSave it as .claude/skills/ecom-rfm-analysis/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
ecom-rfm-analysis
description
Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data. Use this skill when the user needs to segment customers by purchase behavior, identify high-value buyers, design retention campaigns, or prioritize marketing spend by customer value — even if they say 'who are our best customers', 'which customers are at risk of churning', or 'how do we target our marketing'.
metadata.category
WP-01 電商
metadata.tags
e-commerce, rfm, segmentation, customer-analytics

RFM Analysis

Overview

RFM segments customers based on three behavioral dimensions: Recency (when they last bought), Frequency (how often they buy), and Monetary (how much they spend). It converts raw transaction data into actionable customer segments for targeted marketing.

Framework

IRON LAW: RFM Uses ACTUAL Behavior, Not Demographics

RFM is behavioral segmentation — it classifies by what customers DO,
not who they ARE. A 25-year-old and a 65-year-old in the same RFM segment
should receive the same treatment. Never mix RFM with demographic
assumptions.
The Three Dimensions
DimensionWhat It MeasuresHow to Calculate
Recency (R)Days since last purchaseToday - Last purchase date
Frequency (F)Number of purchases in periodCount of distinct transactions
Monetary (M)Total spend in periodSum of transaction values
Scoring Method (Quintile-Based)
  1. For each dimension, rank all customers and divide into 5 equal groups (quintiles)
  2. Score 5 (best) to 1 (worst): R=5 means most recent, F=5 means most frequent, M=5 means highest spend
  3. Combine into 3-digit RFM score (e.g., R5-F4-M5 = recent, frequent, high-value)

Note: For Recency, LOWER days = HIGHER score (more recent is better).

Key Segments
SegmentRFM PatternDescriptionStrategy
ChampionsR5, F5, M5Best customers, recent, frequent, high-valueReward, loyalty program, early access
LoyalR4-5, F4-5, M3-5Consistent buyersUpsell, cross-sell, referral program
Potential LoyalistsR4-5, F2-3, M2-3Recent, moderate frequencyNurture to increase frequency
At RiskR2-3, F3-5, M3-5Were frequent/high-value, not buying recentlyWin-back campaign, special offers
HibernatingR1-2, F1-2, M1-2Long dormant, low valueLow-cost reactivation or let go
New CustomersR5, F1, M1-2Just made first purchaseOnboarding, second-purchase incentive
Implementation Steps

Phase 1: Data Preparation

  • Required: Customer ID, Transaction Date, Transaction Amount
  • Clean: Remove refunds, test orders, internal orders
  • Set analysis window (typically 12-24 months)

Phase 2: Calculate RFM Scores

  • Calculate R, F, M for each customer
  • Assign quintile scores (1-5) for each dimension
  • Combine into segments

Phase 3: Segment and Act

  • Map each customer to a named segment (Champions, At Risk, etc.)
  • Design targeted actions per segment
  • Measure results: did targeted customers behave differently?
Show full SKILL.md (162 more words)Show less

Output Format

markdown
# RFM Analysis: {Business}

## Data Summary
- Customers analyzed: {N}
- Analysis window: {start} to {end}
- Transactions: {N}

## Segment Distribution
| Segment | Count | % | Avg R (days) | Avg F | Avg M |
|---------|-------|---|-------------|-------|-------|
| Champions | {N} | {%} | {days} | {count} | ${X} |
| At Risk | {N} | {%} | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |

## Key Findings
- Top 20% customers contribute {X%} of revenue
- {N} customers at risk of churning (were high-value, now dormant)
- {N} new customers need second-purchase nurturing

## Recommended Actions
| Segment | Action | Channel | Expected Impact |
|---------|--------|---------|----------------|
| Champions | {loyalty reward} | {email/app} | Increase AOV by X% |
| At Risk | {win-back offer} | {email/SMS} | Recover X% of dormant revenue |

Gotchas

  • RFM is backward-looking: It tells you what customers DID, not what they WILL do. Combine with predictive models (CLV prediction) for forward-looking insights.
  • Equal quintiles may not make sense: If 80% of customers bought only once, quintile 1-4 are all "one-time buyers." Consider custom breakpoints based on business context.
  • Monetary can be misleading for subscriptions: If everyone pays the same subscription fee, M dimension adds no information. Drop it and use RF only.
  • B2B vs B2C frequency differs: A B2B customer buying quarterly is "frequent." A B2C customer buying quarterly may be "at risk." Calibrate to business context.
  • Don't over-message At Risk customers: Bombarding dormant customers with emails can increase unsubscribes. One well-crafted win-back campaign is better than weekly emails.

Scripts

ScriptDescriptionUsage
scripts/rfm_score.pyScore customers on R/F/M and assign segment labelspython scripts/rfm_score.py --help

Run python scripts/rfm_score.py --verify to execute built-in sanity tests.

References

  • For Python/SQL implementation code, see references/rfm-implementation.md
  • For CLV prediction extending RFM, see references/clv-prediction.md

© asgard-ai-platform, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in ecom-rfm-analysis of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_input.json
  • references/clv-prediction.md
  • references/rfm-implementation.md
  • scripts/rfm_score.py

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Ecom Rfm Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ecom Rfm Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ecom Rfm Analysis this skillasgard-ai-platform/skills242—~1.3kAutomated safety check: PassMIT
Rfm Customer Segmentationliangdabiao/claude-data-analysis-ultra-main290—~1kAutomated safety check: NotesNone
React Performanceaffaan-m/ECC277k1 repos~4.5kAutomated safety check: PassMIT
Shopify Admin Rfm Customer Segmentation40RTY-ai/shopify-admin-skills194—~1.9kAutomated safety check: PassMIT
Performance Profileralirezarezvani/claude-skills28k—~684Automated safety check: PassMIT
Eighty Twenty Customer Value Rfmhashgraph-online/awesome-codex-plugins1.3k—~770Automated safety check: PassMIT

Similar skills

  • Rfm Customer Segmentation

    liangdabiao/claude-data-analysis-ultra-main

    Perform RFM (Recency, Frequency, Monetary) customer segmentation analysis on e-commerce data.

    290 GitHub stars~1k tokensUpdated 5 mo ago
    Sales & SupportAuto-check: notes
  • React Performance

    affaan-m/ECC

    React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills).

    277k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed
  • Shopify Admin Rfm Customer Segmentation

    40RTY-ai/shopify-admin-skills

    Read-only: scores every customer on Recency, Frequency, and Monetary value to segment them into actionable groups (Champions, Loyal, At-Risk, Lost).

    194 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Performance Profiler

    alirezarezvani/claude-skills

    Systematic performance profiling for Node.js, Python, and Go applications.

    28k GitHub stars~684 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Eighty Twenty Customer Value Rfm

    hashgraph-online/awesome-codex-plugins

    Segment customers and lists by 80/20 value, responsiveness, recency, frequency, and money.

    1.3k GitHub stars~770 tokensUpdated yesterday
    Auto-check passed
  • Performance

    udecode/plate

    Review performance lanes with GitHub-scale tactics not owned by Vercel React rules: cohort segmentation, repeated-unit budgets, interaction-level INP, memory tagging, degradation contracts, browser…

    17k GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed

More from asgard-ai-platform/skills

All 207 skills in this repo
  • Algo Ecom Bm25

    asgard-ai-platform/skills

    Implement BM25 ranking function for e-commerce product search relevance scoring.

    242 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Mfg Cpk

    asgard-ai-platform/skills

    Calculate Cpk process capability index to assess whether a process meets specification requirements.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Price Elasticity

    asgard-ai-platform/skills

    Calculate price elasticity of demand to quantify how price changes affect sales volume.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Bayesian

    asgard-ai-platform/skills

    Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Elo

    asgard-ai-platform/skills

    Implement Elo rating system to rank items or players from pairwise comparison outcomes.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Wilson

    asgard-ai-platform/skills

    Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Ecom Rfm Analysis

What does Ecom Rfm Analysis do?

Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data. Ecom Rfm Analysis is an agent skill from asgard-ai-platform/skills. Perform RFM (Recency, Frequency, Monetary) customer segmentation from transaction data.

When should I use Ecom Rfm Analysis?

Ecom Rfm Analysis fits situations like: the user needs to segment customers by purchase behavior; identify high-value buyers; design retention campaigns; prioritize marketing spend by customer value — even if they say who are our best customers.

How do I install Ecom Rfm Analysis in Claude Code?

Run `npx skills add asgard-ai-platform/skills --skill ecom-rfm-analysis -a claude-code`. Or copy the skill folder (ecom-rfm-analysis in asgard-ai-platform/skills) into .claude/skills/ecom-rfm-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Ecom Rfm Analysis in Codex?

Run `npx skills add asgard-ai-platform/skills --skill ecom-rfm-analysis -a codex`. Or copy the skill folder (ecom-rfm-analysis in asgard-ai-platform/skills) into .agents/skills/ecom-rfm-analysis in your project. Codex loads it when a task matches its description.

Can I use Ecom Rfm Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add asgard-ai-platform/skills --skill ecom-rfm-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ecom-rfm-analysis, .gemini/skills/ecom-rfm-analysis, .github/skills/ecom-rfm-analysis and .opencode/skills/ecom-rfm-analysis in your project.

What does Ecom Rfm Analysis need to run?

Going by SKILL.md and its folder, Ecom Rfm Analysis needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Ecom Rfm Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ecom Rfm Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Ecom Rfm Analysis use?

Ecom Rfm Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ecom Rfm Analysis use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.4k tokens, read only when the agent opens those files.

What are the alternatives to Ecom Rfm Analysis?

Skills that share tags, products or a category with Ecom Rfm Analysis: Rfm Customer Segmentation (liangdabiao/claude-data-analysis-ultra-main, 290 stars), React Performance (affaan-m/ECC, 277k stars), Shopify Admin Rfm Customer Segmentation (40RTY-ai/shopify-admin-skills, 194 stars) and Performance Profiler (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ecom Rfm Analysis?

asgard-ai-platform (a GitHub organization) maintains it in asgard-ai-platform/skills, which has 242 GitHub stars. The repository holds 207 skills in this directory. The repository was last updated on June 6, 2026.

Source: asgard-ai-platform/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.