agentleFS
afelipegafelipeg/Anthropic-Skills-for-enterprise-marketing-os/skills/customer-lifetime-value/SKILL.md

customer-lifetime-value

Skill1 starsChanged 7 months agoMITView on GitHub

Estimates total net profit from a customer over the entire relationship horizon using descriptive, Markov chain, survival regression, and Monte Carlo models. Use when asked to: calculate LTV or CLV or CLTV, determine acquisition spend limits, estimate customer equity, segment customers by long-term profitability, model retention impact on revenue, or size a retention campaign by expected LTV saved. Also trigger when someone says "how much is a customer worth?", "what can we spend to acquire?", "customer equity", "LTV model", "CLV calculation", "lifetime value", "retention impact on revenue", "LTV by segment", "model customer profitability", "predict LTV", "LTV × savability", or provides transaction history data and asks for long-term revenue projections. Always render an inline HTML dashboard as primary output — never just a text table.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Survival model requires lapse definition: Must define churn event heuristically (e.g., 5 months without purchase = lapsed).

    line 164
  2. Distinctive:

    Monte Carlo provides variance, not bias correction: Use MC to communicate uncertainty to CMO/CFO, not to correct model specification.

    line 165

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Customer Lifetime Value (LTV)

Four modeling tiers from descriptive to Monte Carlo simulation. Always outputs an inline HTML dashboard + exec recommendation. Reference book: Katsov §3.5.7 (pp. 113–120).


Core LTV Formula (Berger & Nasr, 1998 — Katsov eq. 3.23)

LTV(u) = Σ_{t=1}^{T}  (R − C) · r^(t−1) / (1 + d)^(t−1)

Parameters:

  • R — average revenue per customer per period
  • C — average cost per customer per period
  • r — retention rate (probability of staying one more period)
  • d — discount rate (cost of capital per period)
  • T — projection horizon (periods)

Key insight: LTV is the upper bound on acquisition spend. Customer equity = Σ LTV(u) across all customers.


Model Selection

ScenarioModelScript
Quick estimate, segment-levelDescriptive (eq. 3.23–3.24)ltv_descriptive.py
Multi-state customer journey (recency/frequency states)Markov Chain (eq. 3.25–3.28)ltv_markov_chain.py
Individual-level with churn survival functionRegression + Survival (eq. 3.30–3.31)ltv_survival.py
Confidence intervals + uncertainty quantificationMonte Carlo on Markovmonte_carlo_ltv.py
Portfolio-level metricCustomer Equitycustomer_equity.py

→ Read references/model_selection_ltv.md for deeper guidance.


Workflow

Step 1 — Gather Parameters

Minimum viable inputs:

  • Net margin per period m₀ = R − C
  • Retention rate r (historical cohort analysis or survival model output)
  • Discount rate d (WACC or cost of capital; 8–15% annually typical)
  • Horizon T (typically 24–60 months)

For Markov: define states (recency buckets), transition matrix P, gain vector G.
For Survival: requires transaction history with churn events or heuristic lapse rule.

Step 2 — Run Model

# Descriptive
python scripts/ltv_descriptive.py --m0 100 --mM 150 --tau 3 --r 0.9 --d 0.1 --T 5

# Markov chain
python scripts/ltv_markov_chain.py --transitions data/transitions.csv \
       --gains "75,-5,-5,0" --discount 0.001 --horizon 24

# Survival regression
python scripts/ltv_survival.py --transactions data/txns.csv --horizon 36

# Monte Carlo
python scripts/monte_carlo_ltv.py --transitions data/transitions.csv \
       --gains "75,-5,-5,0" --n-sims 10000 --horizon 36

Step 3 — Export Dashboard JSON

python scripts/export_ltv_dashboard_json.py --results results/ltv_output.csv \
       --model-type descriptive --output dashboard_data.json

Step 4 — Render Inline Dashboard

Load references/ltv_dashboard_template.html, inject JSON, call show_widget.

Output sequence:

1. [bash_tool] Run model script → capture output
2. [bash_tool] export_ltv_dashboard_json.py → JSON
3. [show_widget] Render HTML dashboard
4. [text] 3–5 line exec recommendation
5. [text] Model caveats / sensitivity notes

Scripts Reference

ScriptKey InputsKey Outputs
ltv_descriptive.pym0, mM, tau, r, d, TLTV table + LTV curve JSON
ltv_markov_chain.pytransitions CSV, gains, d, TLTV vector per initial state
ltv_survival.pytransaction history CSVPer-customer LTV with survival function
monte_carlo_ltv.pytransitions CSV, gains, n_sims, TLTV distribution: mean, p10, p50, p90
customer_equity.pyscored customers CSVTotal customer equity + segment breakdown
export_ltv_dashboard_json.pyany LTV output CSVJSON for HTML dashboard

Output Format — Visualization First

Primary output: inline HTML dashboard (show_widget). Always render before text.

Dashboard panels (see references/ltv_dashboard_template.html):

  1. KPI bar — LTV (base state), customer equity, payback period, breakeven retention rate
  2. LTV curve over time — discounted cumulative LTV vs. horizon (shows saturation)
  3. Retention sensitivity — LTV as function of r from 0.5→0.99
  4. Discount rate sensitivity — LTV as function of d from 0→0.3
  5. Monte Carlo distribution — histogram with p10/p50/p90 bands (if MC model)
  6. Segment comparison table — LTV by customer state / segment

Fallback (if show_widget unavailable): Katsov Table 3.6 format — year | net_profit | retention_rate | expected_profit | discount_multiplier | discounted_profit | cumulative_ltv


Key Equations Reference

# Descriptive with growing net profit (eq. 3.24):
m_t = m0 + (mM − m0)(1 − e^{−kt})    where k = ln(2)/τ

# Regression/Survival LTV (eq. 3.30–3.31):
LTV(u) = Σ_t p(u,t) · m(u,t)
LTV(u) = Σ_t S_u(t) · m(u,t)         [survival function replaces retention]

# Markov LTV (eq. 3.28):
V = Σ_{t=1}^{T} [1/(1+d)^{t−1}] P^t G

# Customer equity:
CE = Σ_u LTV(u)

# Retention budget optimization (eq. 3.49–3.52):
r = r_max(1 − e^{−k_r R})            [retention as function of spend R]
argmax_{A,R} N_p(a·LTV(r) − c) + N_c·LTV(r)   s.t. A + R ≤ budget

Key Caveats

  • Retention rate is the dominant driver. A 5pp improvement in r has larger LTV impact than a 10% increase in margin. Always run sensitivity.
  • Discount rate encodes risk. Higher d → lower LTV → lower acquisition bid ceiling. Use WACC or sector-appropriate rate.
  • Descriptive model ≠ causal model. Changing a marketing action changes r, which changes LTV — the feedback loop requires eq. 3.49.
  • Survival model requires lapse definition. Must define churn event heuristically (e.g., 5 months without purchase = lapsed). Results are sensitive to this.
  • Monte Carlo provides variance, not bias correction. Use MC to communicate uncertainty to CMO/CFO, not to correct model specification.

Integration with Agency Growth OS

SkillHandoff
response-uplift-modelingSavability × LTV → retention targeting score (eq. 3.40)
audience-segmentation-briefSegment-level LTV inputs (R, C, r per persona)
crm-journey-architectLTV payback period → journey trigger timing
margin-simulationCustomer equity → business valuation input
measurement-incrementalityLTV uplift as campaign success metric

Reference Files

  • references/model_selection_ltv.md — Descriptive vs Markov vs Survival decision guide
  • references/katsov_ltv_excerpts.md — Key equations, Table 3.6, and Markov example
  • references/ltv_dashboard_template.html — Reusable HTML dashboard. Inject SKILL_DATA_JSON

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.