sophhub 0.4.20 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/insurance-customer-policy/skill.json +12 -0
- package/skills/insurance-customer-policy/src/SKILL.md +121 -0
- package/skills/insurance-customer-policy/src/pyproject.toml +9 -0
- package/skills/insurance-customer-policy/src/scripts/cli.py +16 -0
- package/skills/insurance-customer-policy/src/scripts/cloud_insurance_full_test.py +785 -0
- package/skills/insurance-customer-policy/src/scripts/dashboard_all.py +205 -0
- package/skills/insurance-customer-policy/src/scripts/insurance_customer_cli/__init__.py +0 -0
- package/skills/insurance-customer-policy/src/scripts/insurance_customer_cli/__main__.py +4 -0
- package/skills/insurance-customer-policy/src/scripts/insurance_customer_cli/cli.py +816 -0
- package/skills/insurance-customer-policy/src/scripts/insurance_customer_cli/db.py +181 -0
- package/skills/insurance-customer-policy/src/scripts/insurance_customer_cli/insurance_paths.py +184 -0
- package/skills/insurance-customer-policy/src/scripts/run_e2e_smoke.py +164 -0
- package/skills/insurance-customer-policy/src/scripts/test_cloud_zero_config.py +217 -0
- package/skills/insurance-customer-policy/src/scripts/test_dashboard_all.py +113 -0
- package/skills/insurance-customer-policy/src/src/insurance_customer_cli/__init__.py +0 -0
- package/skills/insurance-customer-policy/src/src/insurance_customer_cli/__main__.py +4 -0
- package/skills/insurance-customer-policy/src/src/insurance_customer_cli/cli.py +816 -0
- package/skills/insurance-customer-policy/src/src/insurance_customer_cli/db.py +181 -0
- package/skills/insurance-customer-policy/src/src/insurance_customer_cli/insurance_paths.py +184 -0
- package/skills/insurance-product-analysis/skill.json +12 -0
- package/skills/insurance-product-analysis/src/SKILL.md +99 -0
- package/skills/insurance-product-analysis/src/pyproject.toml +9 -0
- package/skills/insurance-product-analysis/src/scripts/cli.py +16 -0
- package/skills/insurance-product-analysis/src/scripts/insurance_product_cli/__init__.py +0 -0
- package/skills/insurance-product-analysis/src/scripts/insurance_product_cli/__main__.py +4 -0
- package/skills/insurance-product-analysis/src/scripts/insurance_product_cli/cli.py +545 -0
- package/skills/insurance-product-analysis/src/scripts/insurance_product_cli/db.py +180 -0
- package/skills/insurance-product-analysis/src/scripts/insurance_product_cli/orchestrator.py +163 -0
- package/skills/insurance-product-analysis/src/scripts/run_e2e_smoke.py +202 -0
- package/skills/insurance-product-analysis/src/src/insurance_product_cli/__init__.py +0 -0
- package/skills/insurance-product-analysis/src/src/insurance_product_cli/__main__.py +4 -0
- package/skills/insurance-product-analysis/src/src/insurance_product_cli/cli.py +545 -0
- package/skills/insurance-product-analysis/src/src/insurance_product_cli/db.py +180 -0
- package/skills/insurance-product-analysis/src/src/insurance_product_cli/orchestrator.py +163 -0
- package/skills/insurance-sales-pipeline/skill.json +12 -0
- package/skills/insurance-sales-pipeline/src/SKILL.md +102 -0
- package/skills/insurance-sales-pipeline/src/pyproject.toml +9 -0
- package/skills/insurance-sales-pipeline/src/scripts/cli.py +16 -0
- package/skills/insurance-sales-pipeline/src/scripts/insurance_pipeline_cli/__init__.py +0 -0
- package/skills/insurance-sales-pipeline/src/scripts/insurance_pipeline_cli/__main__.py +4 -0
- package/skills/insurance-sales-pipeline/src/scripts/insurance_pipeline_cli/cli.py +496 -0
- package/skills/insurance-sales-pipeline/src/scripts/insurance_pipeline_cli/db.py +180 -0
- package/skills/insurance-sales-pipeline/src/scripts/insurance_pipeline_cli/orchestrator.py +36 -0
- package/skills/insurance-sales-pipeline/src/scripts/run_e2e_smoke.py +208 -0
- package/skills/insurance-sales-pipeline/src/src/insurance_pipeline_cli/__init__.py +0 -0
- package/skills/insurance-sales-pipeline/src/src/insurance_pipeline_cli/__main__.py +4 -0
- package/skills/insurance-sales-pipeline/src/src/insurance_pipeline_cli/cli.py +496 -0
- package/skills/insurance-sales-pipeline/src/src/insurance_pipeline_cli/db.py +180 -0
- package/skills/insurance-sales-pipeline/src/src/insurance_pipeline_cli/orchestrator.py +36 -0
- package/skills/insurance-schedule-renewal/skill.json +12 -0
- package/skills/insurance-schedule-renewal/src/SKILL.md +94 -0
- package/skills/insurance-schedule-renewal/src/pyproject.toml +9 -0
- package/skills/insurance-schedule-renewal/src/scripts/cli.py +16 -0
- package/skills/insurance-schedule-renewal/src/scripts/insurance_schedule_cli/__init__.py +0 -0
- package/skills/insurance-schedule-renewal/src/scripts/insurance_schedule_cli/__main__.py +4 -0
- package/skills/insurance-schedule-renewal/src/scripts/insurance_schedule_cli/cli.py +429 -0
- package/skills/insurance-schedule-renewal/src/scripts/insurance_schedule_cli/db.py +180 -0
- package/skills/insurance-schedule-renewal/src/scripts/insurance_schedule_cli/orchestrator.py +94 -0
- package/skills/insurance-schedule-renewal/src/scripts/run_e2e_smoke.py +218 -0
- package/skills/insurance-schedule-renewal/src/src/insurance_schedule_cli/__init__.py +0 -0
- package/skills/insurance-schedule-renewal/src/src/insurance_schedule_cli/__main__.py +4 -0
- package/skills/insurance-schedule-renewal/src/src/insurance_schedule_cli/cli.py +429 -0
- package/skills/insurance-schedule-renewal/src/src/insurance_schedule_cli/db.py +180 -0
- package/skills/insurance-schedule-renewal/src/src/insurance_schedule_cli/orchestrator.py +94 -0
- package/skills/insurance-shared-data/skill.json +20 -0
- package/skills/insurance-shared-data/src/SKILL.md +33 -0
- package/skills/insurance-shared-data/src/scripts/cloud_insurance_super_test.py +246 -0
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "insurance-customer-policy",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"types": ["store"],
|
|
5
|
+
"displayName": "保险客户与保单管理",
|
|
6
|
+
"description": "保险经纪人客户档案、保单关联、跟进记录、保障缺口分析、客户分类的统一管理 CLI。",
|
|
7
|
+
"changelog": [
|
|
8
|
+
{ "version": "1.0.0", "date": "2026-05-09", "changes": ["初版 CLI:customer/policy/followup/gap-analysis/customer-segment/dashboard"] }
|
|
9
|
+
],
|
|
10
|
+
"createdAt": "2026-05-09",
|
|
11
|
+
"updatedAt": "2026-05-09"
|
|
12
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: insurance-customer-policy
|
|
3
|
+
description: "保险经纪人客户与保单管理:客户档案、跨公司保单归集、跟进记录、保障缺口分析、客户分类。触发:保险助手、保险工具箱、新客户、保单查询、跟进记录、保障缺口、客户分类、看下数据。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 保险客户与保单管理(统一数据底座)
|
|
7
|
+
|
|
8
|
+
以「人」为中心管理客户和保单,支持跨公司保单归集、跟进记录、保障缺口分析(重疾/医疗/意外/寿险/养老/教育金 6 维)。
|
|
9
|
+
|
|
10
|
+
## 经营概览("看下数据" / "保险助手" / "保险工具箱")
|
|
11
|
+
|
|
12
|
+
本 skill 自带一个**共享库聚合脚本**,直接从统一数据库读取 4 类经营指标,拼出总览:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
python3 {baseDir}/scripts/dashboard_all.py # 输出 JSON(含 overview + skills 明细 + markdown)
|
|
16
|
+
python3 {baseDir}/scripts/dashboard_all.py --md # 只打印 markdown 卡片
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
输出形如:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
🛡️ **经营概览(2026-05)**
|
|
23
|
+
|
|
24
|
+
👥 客户:120人(高净值15 / 活跃60 / 沉睡35 / 新客10)
|
|
25
|
+
📋 保单:185份(总保费约¥2,800,000)
|
|
26
|
+
📦 产品库:22 款
|
|
27
|
+
⏰ 本月续保:8份 30 天内到期
|
|
28
|
+
🎯 本月目标:保费¥100,000 | 已完成:¥65,000 | 在谈预估:¥23,000 | 在谈商机:12单
|
|
29
|
+
|
|
30
|
+
⚠️ 待处理:
|
|
31
|
+
- 3 份保单 30 天内到期
|
|
32
|
+
- 8 位客户超 30 天未联系
|
|
33
|
+
- 2 位客户超 60 天未联系(沉睡)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 运行方式
|
|
39
|
+
|
|
40
|
+
**推荐(云端零配置 / 跨平台)**:直接用绝对路径调用 wrapper,自动加载包,无需 PYTHONPATH。
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
python3 {baseDir}/scripts/cli.py <子命令> ...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**高级用法**(如要直接 `python -m`):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Linux / macOS
|
|
50
|
+
export PYTHONPATH="{baseDir}/src"
|
|
51
|
+
python3 -m insurance_customer_cli <子命令> ...
|
|
52
|
+
|
|
53
|
+
# Windows
|
|
54
|
+
cd "{baseDir}"
|
|
55
|
+
set PYTHONPATH=%CD%\src
|
|
56
|
+
python -m insurance_customer_cli <子命令> ...
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
默认数据库:
|
|
60
|
+
|
|
61
|
+
- Linux / macOS:`~/.config/insurance/insurance.sqlite3`
|
|
62
|
+
- Windows:`%USERPROFILE%\.config\insurance\insurance.sqlite3`
|
|
63
|
+
- 统一变量:`INSURANCE_DB_PATH`
|
|
64
|
+
- 兼容变量:`INSURANCE_CUSTOMER_DB_PATH`(历史配置仍可用)
|
|
65
|
+
|
|
66
|
+
数据库目录会自动创建;首次调用任一保险 skill 会自动初始化共享表结构,**云端部署无需任何配置**。
|
|
67
|
+
|
|
68
|
+
**路径(对齐美容院 skill,可选运维变量)**:仓库内统一模块 `insurance_customer_cli/insurance_paths.py` 负责解析入口与子进程路径。若挂载布局异常,可设置 `INSURANCE_SKILLS_ROOT`(或通用 `SKILLS_ROOT`)指向包含四个 `insurance-*` 目录的文件夹;也可对各 skill 单独指定 `INSURANCE_CUSTOMER_PKG`(或对应产品的 `INSURANCE_*_PKG`)以及直连 wrapper 的 `INSURANCE_CUSTOMER_CLI_SCRIPT` 等(与各 skill 的 `SKILL_META` 定义一致,类比美容院的 `INVENTORY_SCRIPT_PATH`)。
|
|
69
|
+
|
|
70
|
+
## 子命令
|
|
71
|
+
|
|
72
|
+
| 子命令 | 关键参数 |
|
|
73
|
+
|--------|----------|
|
|
74
|
+
| `customer-add` | `--name --phone --age --household JSON --income --birthday` 等 |
|
|
75
|
+
| `customer-query` | `--keyword` / `--customer-id`(聚合保单数、最近跟进时间) |
|
|
76
|
+
| `customer-update` | `--customer-id --set JSON`(支持 children/spouse/elderly 子键) |
|
|
77
|
+
| `customer-delete` | `--customer-id --yes`(有 active 保单时禁止) |
|
|
78
|
+
| `customer-exists` | `--customer-id`(内部:供其他 skill 校验) |
|
|
79
|
+
| `policy-add` | `--customer-id --company --product --type --coverage --premium --effective-date [--pay-period]`(自动派生 expire/next-pay-date) |
|
|
80
|
+
| `policy-query` | `--customer-id` / `--policy-id` / `--expire-before` / `--next-pay-before` / `--product-type` |
|
|
81
|
+
| `policy-update` | `--policy-id --set JSON` |
|
|
82
|
+
| `policy-delete` | `--policy-id --yes`(软删,状态置 cancelled) |
|
|
83
|
+
| `policy-count-by-customer` | `--customer-id`(内部) |
|
|
84
|
+
| `followup-add` | `--customer-id --content [--next-step --next-date --channel]` |
|
|
85
|
+
| `followup-query` | `--customer-id` / `--days N` |
|
|
86
|
+
| `gap-analysis` | `--customer-id` / `--all` / `--gap-type "重疾险"` |
|
|
87
|
+
| `customer-segment` | 输出 4 类:高净值(年保费>5w)/ 活跃(30天内有跟进)/ 沉睡(60天以上)/ 新客(30天内创建) |
|
|
88
|
+
| `dashboard` | `--json` 返回经营概览数据(供入口聚合) |
|
|
89
|
+
| `customer-field-add` / `customer-field-query` | 自定义字段定义 |
|
|
90
|
+
|
|
91
|
+
## 示例
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python3 {baseDir}/scripts/cli.py customer-add --name "张先生" --phone "13800138000" --age 35 --household "{\"spouse\":true,\"children\":2}" --income 300000
|
|
95
|
+
python3 {baseDir}/scripts/cli.py policy-add --customer-id C001 --company "A保险公司" --product "重疾险XX" --type "重疾险" --coverage 500000 --premium 8000 --effective-date "2023-01-01" --pay-period "20年"
|
|
96
|
+
python3 {baseDir}/scripts/cli.py followup-add --customer-id C001 --content "聊了养老险,很感兴趣" --next-step "下周三见面详聊" --next-date "2024-05-15"
|
|
97
|
+
python3 {baseDir}/scripts/cli.py gap-analysis --customer-id C001
|
|
98
|
+
python3 {baseDir}/scripts/cli.py customer-segment
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 自然语言路由
|
|
102
|
+
|
|
103
|
+
| 用户说 | 调用命令 |
|
|
104
|
+
|--------|----------|
|
|
105
|
+
| "新客户张先生,35岁,两个孩子,年收入30w" | `customer-add` |
|
|
106
|
+
| "张先生的保单有哪些?" | `policy-query --customer-id` |
|
|
107
|
+
| "张先生买了重疾险,保额50w,A保险公司" | `policy-add` |
|
|
108
|
+
| "记录:今天跟张先生聊了养老险" | `followup-add` |
|
|
109
|
+
| "张先生保障够了吗?" | `gap-analysis --customer-id` |
|
|
110
|
+
| "帮我看看客户分类" | `customer-segment` |
|
|
111
|
+
| "看下数据" / "总体怎么样" | `dashboard --json`(同时聚合其他 3 个保险 skill 的 dashboard) |
|
|
112
|
+
|
|
113
|
+
## 内部子命令(供其他 skill)
|
|
114
|
+
|
|
115
|
+
- `customer-exists --customer-id <id>`
|
|
116
|
+
- `policy-count-by-customer --customer-id <id>`
|
|
117
|
+
|
|
118
|
+
## 与其他 Skill 协作
|
|
119
|
+
|
|
120
|
+
- 作为保险系列统一数据底座,四个主 skill 共用同一 `insurance.sqlite3`。
|
|
121
|
+
- 其他 skill 直接读写共享库,不再依赖本 skill 的子进程转发。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Cloud-friendly entrypoint for insurance-customer-policy."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
SCRIPTS_DIR = Path(__file__).resolve().parent
|
|
9
|
+
if str(SCRIPTS_DIR) not in sys.path:
|
|
10
|
+
sys.path.insert(0, str(SCRIPTS_DIR))
|
|
11
|
+
|
|
12
|
+
from insurance_customer_cli.cli import main
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
raise SystemExit(main(sys.argv[1:]))
|