clv-modeling
Use when the user mentions CLV, LTV, customer lifetime value, customer value prediction, lifetime revenue, CLV:CAC ratio, BG/NBD, Gamma-Gamma, RFM summary, purchase frequency prediction, monetary value prediction, churn probability, customer retention modeling, expected transactions, customer-level forecasting, or high-value customer identification. Also trigger on 'which customers are most valuable' or 'predict future customer revenue.' For grouping customers into segments or cohort retention curves use audience-segmentation; for lead propensity scoring use crm-lead-scoring; this skill predicts per-customer future value. If transaction data is not yet in the workspace, run data-extraction first.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- clv-modeling
- description
- Use when the user mentions CLV, LTV, customer lifetime value, customer value prediction, lifetime revenue, CLV:CAC ratio, BG/NBD, Gamma-Gamma, RFM summary, purchase frequency prediction, monetary value prediction, churn probability, customer retention modeling, expected transactions, customer-level forecasting, or high-value customer identification. Also trigger on 'which customers are most valuable' or 'predict future customer revenue.' For grouping customers into segments or cohort retention curves use audience-segmentation; for lead propensity scoring use crm-lead-scoring; this skill predicts per-customer future value. If transaction data is not yet in the workspace, run data-extraction first.
- disable-model-invocation
- false
02 资源文件 8
- 参考文档references/authoring-notes.md2.5 KB
- 参考文档references/clv_methodology.md6.5 KB
- 参考文档references/pymc_marketing_clv.md8.0 KB
- 其他routing-eval.jsonl908 B
- 脚本scripts/fit_bgnbd.py19.7 KB
- 脚本scripts/predict_clv.py26.9 KB
- 脚本scripts/rfm_summary.py11.8 KB
- 脚本scripts/validate_clv.py23.6 KB
03 SKILL.md 正文
CLV Modeling
Probabilistic customer lifetime value: BG/NBD for purchase frequency, Gamma-Gamma for monetary value, Beta-Geometric for subscriptions — with confidence intervals, CLV:CAC, cohort curves, and at-risk high-value alerts.
Contract
Role: Advisory modeler. This skill computes and reports predicted value; it does not target, price, or contact customers. All numbers come from deterministic Python scripts, never from model estimation in prose.
Mode:
quick— RFM summary + single-horizon MLE point estimates.standard(default) — MLE BG/NBD + Gamma-Gamma, CIs, tiers, at-risk list, holdout validation.deep— add Bayesian (PyMC-Marketing) posteriors and full uncertainty.
When to use: predicting future per-customer revenue, CLV:CAC, at-risk high-value retention targets, purchase-frequency / probability-alive scoring.
When NOT to use: for building customer segments or cohort retention curves use
audience-segmentation; for sales-lead propensity use crm-lead-scoring; for
channel ROI use attribution-analysis. See ../../references/skill-index.md for
the full portfolio map.
Evidence required (inputs):
workspace/raw/transactions.csv—customer_id,date,amount(required for non-contractual). If absent, STOP and run data-extraction first.workspace/raw/subscriptions.csv—customer_id,start_date,end_date,plan_value(optional; enables contractual model).workspace/analysis/acquisition_costs.json— CAC by customer/segment (optional; enables CLV:CAC).
Depends on: data-extraction (raw transactions). Feeds into:
audience-segmentation (value tiers), paid-media (bid targets), email-analytics
(lifecycle triggers), attribution-analysis, reporting. Builder detail lives in
references/authoring-notes.md.
Hard STOP (data integrity): stop and surface the issue before modeling if any of these appear — future-dated transactions, negative/zero amounts as a material share, or fewer than ~2 repeat purchasers (BG/NBD is unidentifiable). Do not emit CLV numbers from broken inputs.
Parse $ARGUMENTS for inline paths, horizon, discount rate, or model overrides.
Workflow
-
Validate & profile. Load transactions; parse dates robustly (ISO/US/EU). Flag duplicates (same customer/date/amount), negative/zero amounts, and impossible dates. Report customer count, date range, transaction volume. Apply the Hard STOP gate above.
-
RFM summary. Run
scripts/rfm_summary.pyto build recency, frequency (repeat purchases only), tenure (T), and mean repeat monetary value. One-time purchasers: frequency=0, monetary=NaN (excluded from Gamma-Gamma). -
Model-class gate (AskUserQuestion). When both transaction and subscription data exist, or the business model is ambiguous, ask before fitting:
- Question: "Which lifetime model fits this business?"
- Options: (a) Non-contractual (BG/NBD + Gamma-Gamma) — purchases happen at will, no fixed renewal; (b) Contractual (Beta-Geometric) — subscription with renewal periods; (c) Both, compared — fit each and reconcile. Skip the prompt when only one data type is present (default to it).
-
Fit. Non-contractual: run
scripts/fit_bgnbd.py(BetaGeoFitter MLE → r, alpha, a, b; per-customer expected transactions and probability-alive; then Gamma-Gamma on frequency>0 customers). Validate Gamma-Gamma independence: if corr(frequency, monetary) > 0.3, warn and record potential bias. Contractual: fit Beta-Geometric on renewal-period survival data. -
Bayesian extension (deep mode). Use
pymc_marketing.clvBetaGeoModel and GammaGammaModel; check R-hat < 1.01, ESS > 400; report median CLV with 80% and 95% credible intervals per customer. -
Predict & score. Run
scripts/predict_clv.pyfor horizons (default 6/12/24 months) with point estimate + interval. Compute CLV = E[transactions] × E[monetary] × margin × discount_factor. Ifacquisition_costs.jsonis present, compute CLV:CAC and flag ratio < 1.0; if absent, flag transparently and skip. Tier customers Platinum/Gold/Silver/Bronze by CLV percentile. Build the at-risk list: top-10% CLV × probability-alive dropped below 50% this quarter. -
Validate. Run
scripts/validate_clv.pywith a temporal holdout (calibration/holdout split): report MAE, RMSE, and calibration ratio (predicted/actual, target 0.9–1.1). -
Report. Write outputs (below) and the HTML dashboard.
Output Format
Artifacts:
| File | Contents |
|---|---|
workspace/analysis/clv_predictions.json |
Customer-level CLV with confidence intervals |
workspace/analysis/clv_segments.json |
CLV tiers (Platinum/Gold/Silver/Bronze) |
workspace/analysis/at_risk_customers.json |
High-value customers with declining probability-alive |
workspace/reports/clv_analysis.html |
CLV distributions, cohort curves, model diagnostics |
Every readout states: model class, horizon, discount rate, holdout MAE/calibration ratio, and whether CLV:CAC was computed or skipped.
Financial services mode: aggregate CLV across products at the household level; support AUM-basis-point monetary components; compute relationship-level CLV for advisor-intermediated books. Document model inputs for fair-lending review. If CLV outputs feed any customer-facing claim or projected-return copy, route that content through the compliance-review skill before distribution.
Completion status — end every run with one:
DONE— models fit, holdout passed, artifacts written.DONE_WITH_CONCERNS— shipped but note the caveat (e.g., Gamma-Gamma independence violated, weak holdout calibration, CLV:CAC skipped).BLOCKED— Hard STOP tripped or required input missing; state the fix.NEEDS_CONTEXT— model-class or horizon ambiguity unresolved by the user.
Anti-Patterns
- Emitting CLV numbers from data that failed the integrity gate (future dates, negative amounts, too few repeat buyers).
- Reporting point estimates without confidence/credible intervals.
- Running Gamma-Gamma on one-time purchasers, or ignoring a frequency–monetary correlation above 0.3.
- Presenting CLV:CAC when acquisition-cost data is missing instead of flagging it.
- Using a random (not temporal) holdout — it leaks future information.
- Letting the model narrate CLV or probability-alive instead of running the scripts.
- Defaulting to a contractual or non-contractual model without checking which data the business actually has.
04 同仓库更多 Skills
minimal-skill
Minimal shared skill fixture for marketplace renderer and validator examples.
roadmap
Use this skill when the user wants a product roadmap, initiative sequencing, Now/Next/Later plan, quarterly roadmap, release theme map, product strategy-to-roadmap translation, or executive roadmap narrative. Trigger on phrases like "build a roadmap", "roadmap these initiatives", "what should be now next later", "sequence this backlog", "quarterly product roadmap", "theme-based roadmap", or "plan the next two quarters". Do NOT trigger for drafting or reviewing a single PRD (use prd-writer or prd-review), converting a PRD into an agentic PLAN.md (use prd-to-plan), or scoring/ranking a set of options without a time horizon (use prioritization).
prioritization
Use this skill when the user wants to rank, score, triage, or compare product opportunities, features, PRD requirements, backlog items, roadmap candidates, or initiatives using RICE, impact-effort, confidence, reach, value, effort, risk, or tradeoff analysis. Trigger on phrases like "prioritize these features", "rank this backlog", "RICE score", "impact effort matrix", "what should we build first", "compare these initiatives", or "stack rank product bets". Do NOT trigger for a time-based roadmap (use roadmap), writing or reviewing one PRD (use prd-writer or prd-review), turning a PRD into an agentic plan (use prd-to-plan), or analyzing experiment results (use ab-testing or experimentation skills).
prd-writer
Use this skill whenever the user wants to write, draft, create, or scaffold a PRD (Product Requirements Document), spec, product brief, one-pager, or "working backwards" PR/FAQ from an idea, rough notes, discovery inputs, or an existing partial draft that needs authoring. Trigger on phrases like "write a PRD", "draft a spec", "product doc for X", "one-pager", "PR/FAQ", "feature brief", or when the user describes a feature/product idea and asks for it to be turned into a written requirements document. Do NOT trigger for critique or approval-readiness review of an existing PRD (use prd-review), engineering design docs, RFCs, ADRs, prioritization, roadmaps, or technical architecture documents. The output of this skill is always a markdown file (or section thereof) that a real product team could ship from.
prd-to-plan
Use this skill when the user has a PRD (Product Requirements Document), spec, or product brief and wants to turn it into an executable plan for agentic development — a plan that AI coding agents (Claude Code, sub-agents, orchestrators) can actually run. Trigger on phrases like "turn this PRD into a plan", "agentic plan", "execution plan", "task graph", "break this down for Claude Code", "decompose this spec", "build plan", "implementation plan from PRD", "scrum-master plan", or when the user provides a PRD/spec and asks "what's next" or "how do we build this with agents". The output is always a structured `PLAN.md` artifact with phases, tasks, dependencies, validation gates, sub-agent assignments, and context bundles. Do NOT trigger for: writing the PRD itself (use prd-writer), pure engineering design / RFC / ADR (architecture is a separate artifact), or generic project management plans without an agentic execution model.
prd-review
Use this skill when the user has an existing PRD, product spec, one-pager, or PR/FAQ and wants critique, approval-readiness review, quality-bar scoring, required changes, or a red-team pass. Trigger on phrases like "review this PRD", "critique my product spec", "is this PRD ready", "PRD quality bar", "red-team this requirements doc", "find gaps in this PR/FAQ", or "what would block approval". Do NOT trigger for drafting a new PRD from an idea (use prd-writer), converting an approved PRD into an agentic implementation plan (use prd-to-plan), building a roadmap (use roadmap), or ranking multiple initiatives (use prioritization).