Customer Success Manager
Production-grade customer success analytics with multi-dimensional health scoring, churn risk prediction, and expansion opportunity identification. Three Python CLI tools provide deterministic, repeatable analysis using standard library only -- no external dependencies, no API calls, no ML models.
Table of Contents
Input Requirements
All scripts accept a JSON file as positional input argument. See assets/sample_customer_data.json for complete schema examples and sample data.
Health Score Calculator
Required fields per customer object: customer_id, name, segment, arr, and nested objects usage (loginfrequency, featureadoption, daumauratio), engagement (supportticketvolume, meetingattendance, npsscore, csatscore), support (opentickets, escalationrate, avgresolutionhours), relationship (executivesponsorengagement, multithreadingdepth, renewalsentiment), and previous_period scores for trend analysis.
Churn Risk Analyzer
Required fields per customer object: customer_id, name, segment, arr, contract_end_date, and nested objects usage_decline, engagement_drop, support_issues, relationship_signals, and commercial_factors.
Expansion Opportunity Scorer
Required fields per customer object: customer_id, name, segment, arr, and nested objects contract (licensedseats, activeseats, plantier, availabletiers), product_usage (per-module adoption flags and usage percentages), and departments (current and potential).
Output Formats
All scripts support two output formats via the --format flag:
- -
text (default): Human-readable formatted output for terminal viewing json: Machine-readable JSON output for integrations and pipelines
How to Use
Quick Start
CODEBLOCK0
Workflow Integration
CODEBLOCK1
Error handling: If a script exits with an error, check that:
- - The input JSON matches the required schema for that script (see Input Requirements above)
- All required fields are present and correctly typed
- Python 3.7+ is being used (
python --version) - Output files from prior steps are non-empty before piping into subsequent steps
Scripts
1. healthscorecalculator.py
Purpose: Multi-dimensional customer health scoring with trend analysis and segment-aware benchmarking.
Dimensions and Weights:
| Dimension | Weight | Metrics |
|---|
| Usage | 30% | Login frequency, feature adoption, DAU/MAU ratio |
| Engagement |
25% | Support ticket volume, meeting attendance, NPS/CSAT |
| Support | 20% | Open tickets, escalation rate, avg resolution time |
| Relationship | 25% | Executive sponsor engagement, multi-threading depth, renewal sentiment |
Classification:
- - Green (75-100): Healthy -- customer achieving value
- Yellow (50-74): Needs attention -- monitor closely
- Red (0-49): At risk -- immediate intervention required
Usage:
CODEBLOCK2
2. churnriskanalyzer.py
Purpose: Identify at-risk accounts with behavioral signal detection and tier-based intervention recommendations.
Risk Signal Weights:
| Signal Category | Weight | Indicators |
|---|
| Usage Decline | 30% | Login trend, feature adoption change, DAU/MAU change |
| Engagement Drop |
25% | Meeting cancellations, response time, NPS change |
| Support Issues | 20% | Open escalations, unresolved critical, satisfaction trend |
| Relationship Signals | 15% | Champion left, sponsor change, competitor mentions |
| Commercial Factors | 10% | Contract type, pricing complaints, budget cuts |
Risk Tiers:
- - Critical (80-100): Immediate executive escalation
- High (60-79): Urgent CSM intervention
- Medium (40-59): Proactive outreach
- Low (0-39): Standard monitoring
Usage:
CODEBLOCK3
3. expansionopportunityscorer.py
Purpose: Identify upsell, cross-sell, and expansion opportunities with revenue estimation and priority ranking.
Expansion Types:
- - Upsell: Upgrade to higher tier or more of existing product
- Cross-sell: Add new product modules
- Expansion: Additional seats or departments
Usage:
python scripts/expansion_opportunity_scorer.py customer_data.json
python scripts/expansion_opportunity_scorer.py customer_data.json --format json
Reference Guides
| Reference | Description |
|---|
| INLINECODE31 | Complete health scoring methodology, dimension definitions, weighting rationale, threshold calibration |
| INLINECODE32 |
Intervention playbooks for each risk tier, onboarding, renewal, expansion, and escalation procedures |
|
references/cs-metrics-benchmarks.md | Industry benchmarks for NRR, GRR, churn rates, health scores, expansion rates by segment and industry |
Templates
| Template | Purpose |
|---|
| INLINECODE34 | Quarterly Business Review presentation structure |
| INLINECODE35 |
Customer success plan with goals, milestones, and metrics |
|
assets/onboarding_checklist_template.md | 90-day onboarding checklist with phase gates |
|
assets/executive_business_review_template.md | Executive stakeholder review for strategic accounts |
Best Practices
- 1. Combine signals: Use all three scripts together for a complete customer picture
- Act on trends, not snapshots: A declining Green is more urgent than a stable Yellow
- Calibrate thresholds: Adjust segment benchmarks based on your product and industry per INLINECODE38
- Prepare with data: Run scripts before every QBR and executive meeting; reference
references/cs-playbooks.md for intervention guidance
Limitations
- - No real-time data: Scripts analyze point-in-time snapshots from JSON input files
- No CRM integration: Data must be exported manually from your CRM/CS platform
- Deterministic only: No predictive ML -- scoring is algorithmic based on weighted signals
- Threshold tuning: Default thresholds are industry-standard but may need calibration for your business
- Revenue estimates: Expansion revenue estimates are approximations based on usage patterns
Last Updated: February 2026
Tools: 3 Python CLI tools
Dependencies: Python 3.7+ standard library only
客户成功经理
生产级客户成功分析工具,具备多维度健康评分、流失风险预测和扩展机会识别功能。三个Python CLI工具仅使用标准库提供确定性和可重复的分析——无需外部依赖、无需API调用、无需机器学习模型。
目录
输入要求
所有脚本均接受JSON文件作为位置输入参数。完整的模式示例和样本数据请参见assets/samplecustomerdata.json。
健康评分计算器
每个客户对象必填字段:customerid、name、segment、arr,以及嵌套对象usage(登录频率、功能采用率、日活/月活比)、engagement(支持工单量、会议出席率、NPS评分、CSAT评分)、support(未结工单、升级率、平均解决时间)、relationship(高管赞助人参与度、多线程深度、续约意向),以及用于趋势分析的previousperiod评分。
流失风险分析器
每个客户对象必填字段:customerid、name、segment、arr、contractenddate,以及嵌套对象usagedecline、engagementdrop、supportissues、relationshipsignals和commercialfactors。
扩展机会评分器
每个客户对象必填字段:customerid、name、segment、arr,以及嵌套对象contract(许可席位、活跃席位、计划层级、可用层级)、productusage(各模块采用标志和使用百分比)和departments(当前和潜在部门)。
输出格式
所有脚本通过--format标志支持两种输出格式:
- - text(默认):适合终端查看的人类可读格式化输出
- json:适合集成和管道的机器可读JSON输出
使用方法
快速开始
bash
健康评分
python scripts/health
scorecalculator.py assets/sample
customerdata.json
python scripts/health
scorecalculator.py assets/sample
customerdata.json --format json
流失风险分析
python scripts/churn
riskanalyzer.py assets/sample
customerdata.json
python scripts/churn
riskanalyzer.py assets/sample
customerdata.json --format json
扩展机会评分
python scripts/expansion
opportunityscorer.py assets/sample
customerdata.json
python scripts/expansion
opportunityscorer.py assets/sample
customerdata.json --format json
工作流集成
bash
1. 对整个客户组合进行健康评分
python scripts/health
scorecalculator.py customer
portfolio.json --format json > healthresults.json
验证:确认health_results.json包含预期数量的客户记录后再继续
2. 识别高风险账户
python scripts/churn
riskanalyzer.py customer
portfolio.json --format json > riskresults.json
验证:确认risk_results.json非空且每个客户都有风险等级
3. 在健康账户中寻找扩展机会
python scripts/expansion
opportunityscorer.py customer
portfolio.json --format json > expansionresults.json
验证:确认expansion_results.json按优先级列出了机会
4. 使用模板准备季度业务回顾
参考:assets/qbr_template.md
错误处理: 如果脚本退出并报错,请检查:
- - 输入JSON是否符合该脚本所需的模式(参见上方输入要求)
- 所有必填字段是否存在且类型正确
- 是否使用Python 3.7+(python --version)
- 在管道传递到后续步骤之前,前置步骤的输出文件非空
脚本
1. healthscorecalculator.py
目的: 多维度客户健康评分,包含趋势分析和细分市场基准对标。
维度和权重:
| 维度 | 权重 | 指标 |
|---|
| 使用情况 | 30% | 登录频率、功能采用率、日活/月活比 |
| 参与度 |
25% | 支持工单量、会议出席率、NPS/CSAT |
| 支持 | 20% | 未结工单、升级率、平均解决时间 |
| 关系 | 25% | 高管赞助人参与度、多线程深度、续约意向 |
分类:
- - 绿色(75-100):健康——客户正在实现价值
- 黄色(50-74):需关注——密切监控
- 红色(0-49):有风险——需要立即干预
使用方式:
bash
python scripts/healthscorecalculator.py customer_data.json
python scripts/healthscorecalculator.py customer_data.json --format json
2. churnriskanalyzer.py
目的: 通过行为信号检测和基于风险等级的干预建议,识别高风险账户。
风险信号权重:
| 信号类别 | 权重 | 指标 |
|---|
| 使用量下降 | 30% | 登录趋势、功能采用率变化、日活/月活变化 |
| 参与度下降 |
25% | 会议取消、响应时间、NPS变化 |
| 支持问题 | 20% | 未解决升级、未解决关键问题、满意度趋势 |
| 关系信号 | 15% | 关键联系人离职、赞助人变更、竞品提及 |
| 商业因素 | 10% | 合同类型、定价投诉、预算削减 |
风险等级:
- - 严重(80-100):立即上报高管
- 高(60-79):紧急CSM干预
- 中(40-59):主动外联
- 低(0-39):标准监控
使用方式:
bash
python scripts/churnriskanalyzer.py customer_data.json
python scripts/churnriskanalyzer.py customer_data.json --format json
3. expansionopportunityscorer.py
目的: 识别追加销售、交叉销售和扩展机会,包含收入估算和优先级排序。
扩展类型:
- - 追加销售:升级到更高层级或更多现有产品
- 交叉销售:新增产品模块
- 扩展:增加席位或部门
使用方式:
bash
python scripts/expansionopportunityscorer.py customer_data.json
python scripts/expansionopportunityscorer.py customer_data.json --format json
参考指南
| 参考文档 | 描述 |
|---|
| references/health-scoring-framework.md | 完整的健康评分方法论、维度定义、权重原理、阈值校准 |
| references/cs-playbooks.md |
各风险等级的干预手册、入职、续约、扩展和升级流程 |
| references/cs-metrics-benchmarks.md | NRR、GRR、流失率、健康评分、按细分市场和行业的扩展率的行业基准 |
模板
| 模板 | 用途 |
|---|
| assets/qbrtemplate.md | 季度业务回顾演示结构 |
| assets/successplan_template.md |
包含目标、里程碑和指标的客户成功计划 |
| assets/onboarding
checklisttemplate.md | 包含阶段门控的90天入职检查清单 |
| assets/executive
businessreview_template.md | 面向战略客户的高管利益相关者回顾 |
最佳实践
- 1. 综合信号:同时使用所有三个脚本获取完整的客户画像
- 关注趋势而非快照:一个下降中的绿色比一个稳定的黄色更紧迫
- 校准阈值:根据您的产品和行业,参照references/health-scoring-framework.md调整细分市场基准
- 数据准备:在每次季度业务回顾和高管会议前运行脚本;参照references/cs-playbooks.md获取干预指导
局限性
- - 无实时数据:脚本分析的是JSON输入文件中的时间点快照
- 无CRM集成:数据需从CRM/CS平台手动导出
- 仅确定性分析:无预测性机器学习——评分基于加权信号的算法
- 阈值调整:默认阈值为行业标准,但可能需要根据您的业务进行校准
- 收入估算:扩展收入估算基于使用模式的近似值
最后更新: 2026年2月
工具: 3个Python CLI工具
依赖: 仅Python 3.7+标准库