--- name: claw-customer-radar description: Compute Customer Health Score, sentiment trend, RFM, decision-chain map, churn signals. Fire Andon alerts when health crosses thresholds. version: 0.1.0 author: Moments / Atlas team license: MIT metadata: hermes: category: atlas tags: [customer-success, chs, voc, churn, rfm, andon, atlas] related_skills: [claw-email-parser, claw-project-tracker, claw-report-writer] boundaries: - cross_customer_data_isolation --- # claw-customer-radar ## Purpose Atlas's third lens (after project and people). Tracks each external customer as an entity with health, sentiment trajectory, and early-warning signals. ## Inputs - Email JSON (focus on external sender domains) - `state/projects/*.json` (for project-health input to CHS) - `state/customers/*.json` (existing customer cards) ## Outputs - `state/customers/CUST-*.json` - Andon alert JSON to `state/runs/alerts.json` when health crosses thresholds - New `state/customers/UNCLASSIFIED-.json` for unknown customer domains ## Customer Health Score (CHS) ``` CHS = 0.4 × project_health + 0.3 × sentiment_trend_30d + 0.2 × email_frequency_normalcy + 0.1 × monetary_scale Tier: ≥ 80 → 🟢 Green 60 – 79 → 🟡 Yellow < 60 → 🔴 Red ``` ### project_health - Per associated project: Active=1.0, Stalled=0.3, Completed (recent)=1.0, Dropped=0 - Weighted average across that customer's projects ### sentiment_trend_30d - VoC: extract customer-side quotes from Email JSON - Sentiment scoring: per-quote score in [-1, +1] via LLM with calibrated rubric - Trend = slope of last 30 days; convert to [0, 1] with `0.5 + slope/2` ### email_frequency_normalcy - Compare last-30-day frequency to trailing-90-day baseline - 0.5 ± deviation; ≤ 0.3 means significant drop (silence is a churn signal) ### monetary_scale - Sum of associated project amounts, normalized against this client's customer book - Big customers tilt the score so a Yellow on a whale beats a Yellow on a small one ## Sentiment Trend (separate field) Stored as a 90-day series for chart rendering: ```json "情绪趋势_90d": [ {"date": "2026-02", "score": 0.7, "代表词": "期待 / 配合"}, {"date": "2026-03", "score": 0.5, "代表词": "等候 / 询问"}, {"date": "2026-04", "score": 0.2, "代表词": "催 / 失望"} ] ``` ## VoC Extraction Rules Surface up to 5 most-impactful customer quotes per 30-day window: - Strong negative (`再这样我就找别家`, `你们到底什么时候能...`) - Strong positive (`做得不错`, `非常感谢`) - Decision-maker direct intervention (boss-level customer person speaks up) - Threats / explicit deadlines Each quote keeps source email ID and speaker identity. ## Decision Chain Map For each customer, identify 2–5 key external people and their role: | Role | Heuristic | |------|-----------| | `决策者` | most senior title in signature; or person whose intervention shifts thread | | `执行接口` | most frequent external sender on operational topics | | `用户` | recipient of deliverables, may be silent | | `阻拦者` | person who frequently raises objections | ## Churn Signals Maintain a list of signals; populate when triggered: | Signal | Trigger | |--------|---------| | `决策者亲自施压` | Decision-maker speaks up after silence | | `频率骤降` | 30d frequency < 30% of 90d baseline | | `合同到期临近` | Within 60 days of known contract end (boss-provided) | | `负面 VoC 累积` | ≥ 3 strong-negative quotes in 30 days | | `项目同时 stall` | ≥ 2 projects with this customer in Stalled simultaneously | | `关键人离职` | Detected via OOO message + replacement signature | ## Andon Alert Triggers (fire to `state/runs/alerts.json`) - Tier transition Green→Yellow or Yellow→Red - Strong-negative VoC quote - ≥ 2 active churn signals simultaneously Each alert includes: customer_id, trigger, source email IDs, recommended boss action, suppression-key (don't re-fire same alert within 24h of acknowledgment). ## Sample Output See `state-schemas/customer.md` for full example. Key fields produced: - `id`, `name`, `lifecycle_stage` - `健康度` { score, 档位, 构成 } - `情绪趋势_90d` - `RFM` { Recency, Frequency, Monetary } - `我方接口人` (cross-ref to people) - `客户方决策链` - `VoC_关键原话_30d` - `流失预警信号` - `老板视角建议`