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
- vivy-yi/xiaohongshu-skillstheir own version, first seen Jan 22, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- vivy-yi/xiaohongshu-skills★ 470same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agency-request-intake-routerSkill
- analyzing-marketing-campaignSkill
- audience-segmentation-briefSkill
- campaign-launch-qaSkill
- change-order-generatorSkill
- client-memory-synthesizerSkill
- creative-supply-plannerSkill
- crm-journey-architectSkill
- customer-segmentation-clusteringSkill
- data-intake-normalizerSkill
- executive-growth-memoSkill
- fte-capacity-sizingSkill
- margin-simulationSkill
- market-basket-analysisSkill
- measurement-incrementalitySkill
- media-procurement-benchmarkSkill
- media-routing-plannerSkill
- mmm-modelingSkill
- performance-diagnosisSkill
- ppa-assortment-diagnosisSkill
- ppa-continuous-optimizationSkill
- ppa-financial-modelSkill
- ppa-pack-size-leverageSkill
- ppa-value-perceptionSkill
- price-demand-optimizationSkill
- price-elasticity-modelingSkill
- price-threshold-detectionSkill
- qbr-generatorSkill
- recommender-systemsSkill
- response-uplift-modelingSkill
- rfp-submissionSkill
- scope-auditSkill
- survival-analysis-marketingSkill
- weekly-control-towerSkill
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
- Distinctive: line 164
Survival model requires lapse definition: Must define churn event heuristically (e.g., 5 months without purchase = lapsed).
- Distinctive: line 165
Monte Carlo provides variance, not bias correction: Use MC to communicate uncertainty to CMO/CFO, not to correct model specification.
≈ “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.
Files
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
| Scenario | Model | Script |
| Quick estimate, segment-level | Descriptive (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 function | Regression + Survival (eq. 3.30–3.31) | ltv_survival.py |
| Confidence intervals + uncertainty quantification | Monte Carlo on Markov | monte_carlo_ltv.py |
| Portfolio-level metric | Customer Equity | customer_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 36Step 3 — Export Dashboard JSON
python scripts/export_ltv_dashboard_json.py --results results/ltv_output.csv \
--model-type descriptive --output dashboard_data.jsonStep 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 notesScripts Reference
| Script | Key Inputs | Key Outputs |
ltv_descriptive.py | m0, mM, tau, r, d, T | LTV table + LTV curve JSON |
ltv_markov_chain.py | transitions CSV, gains, d, T | LTV vector per initial state |
ltv_survival.py | transaction history CSV | Per-customer LTV with survival function |
monte_carlo_ltv.py | transitions CSV, gains, n_sims, T | LTV distribution: mean, p10, p50, p90 |
customer_equity.py | scored customers CSV | Total customer equity + segment breakdown |
export_ltv_dashboard_json.py | any LTV output CSV | JSON 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):
- KPI bar — LTV (base state), customer equity, payback period, breakeven retention rate
- LTV curve over time — discounted cumulative LTV vs. horizon (shows saturation)
- Retention sensitivity — LTV as function of r from 0.5→0.99
- Discount rate sensitivity — LTV as function of d from 0→0.3
- Monte Carlo distribution — histogram with p10/p50/p90 bands (if MC model)
- 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 ≤ budgetKey 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
| Skill | Handoff |
response-uplift-modeling | Savability × LTV → retention targeting score (eq. 3.40) |
audience-segmentation-brief | Segment-level LTV inputs (R, C, r per persona) |
crm-journey-architect | LTV payback period → journey trigger timing |
margin-simulation | Customer equity → business valuation input |
measurement-incrementality | LTV uplift as campaign success metric |
Reference Files
references/model_selection_ltv.md— Descriptive vs Markov vs Survival decision guidereferences/katsov_ltv_excerpts.md— Key equations, Table 3.6, and Markov examplereferences/ltv_dashboard_template.html— Reusable HTML dashboard. InjectSKILL_DATA_JSON
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
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.

