Maintain a persistent SQLite customer database within the sales-cs workspace. The system hook injects peer (DB primary key) and the Sender block provides user_id_external (raw awada user ID). Use peer for all DB operations.
52
57%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./crews/sales-cs/skills/customer-db/SKILL.md本技能让 sales-cs 在自身 workspace 的 db/ 目录下维护一个轻量级 SQLite 数据库,用于跨会话保存客户商业推进状态与基本画像。
数据库固定位置:
./db/customer.db./db/schema.sql默认表:cs_record,主键列:peer
本系统中客户有两个不同的标识符,用途不同,不可混用:
数据库主键。由系统 hook 从当前会话 sessionKey 中提取并注入,是 cs_record 表的 peer 列的值。所有写库操作必须使用此值。
id 字段)awada 原始用户标识,由 awada-server 直接提供。每轮对话开始时,openclaw 会在消息上下文中注入 Sender 信息块:
Sender (untrusted metadata):
{
"label": "...",
"id": "<user_id_external>",
"name": "..."
}需要与 awada 平台交互的技能(如 exp-invite)必须使用此值,而不是 peer。
当前客户数据库主键,等于 awada sessionKey 中的用户标识(经过安全过滤后的形式)。
表示客户商业推进深度:
free:尚未购买、仍在了解或观望exp_invited:已被邀请体验,但尚未正式付费club:已进入vip club会员阶段subs:预留未来业务用,现阶段未启用club 加入日期,格式建议为 YYYY-MM-DD客户主要业务应用场景,例如:
客户从哪里了解到我们,例如:
created_at:首次建档时间updated_at:最近对话时间(每次收到消息由 hook 自动更新)每轮结束前,根据本轮对话进展更新 purpose 和/或 prompt_source:
./skills/customer-db/scripts/cs-update.sh \
--peer "<[CustomerDB].peer>" \
--purpose "新媒体运营" \
--prompt-source "GitHub"参数均为可选(只传有明确新值的字段);脚本会自动忽略空值,不覆盖已有记录。
更新原则:
business_status 由系统 hook 负责(支付/入群事件),不在此处更新follow_up 表记录客户延迟购买意向,供 heartbeat 定时跟进。status 流转:pending → sent_once → completed。
若同一客户已有 pending 状态的旧任务,先取消旧任务,再创建新任务:
# 第一步:取消同一客户的旧 pending 任务
./skills/customer-db/scripts/follow-up-cancel-pending.sh \
--peer "<[CustomerDB].peer>"
# 第二步:创建新任务
./skills/customer-db/scripts/follow-up-create.sh \
--peer "<[CustomerDB].peer>" \
--user-id-external "<Sender.id>" \
--follow-up-at "<YYYY-MM-DD HH:MM>" \
--reason "<原因,如:客户说明天发工资再买>" \
--context-summary "<客户核心兴趣点和建议跟进角度>"heartbeat 完整执行流程见 HEARTBEAT.md
超过 48 小时仍为 pending 的任务视为客户失联,自动标记完成:
./skills/customer-db/scripts/follow-up-expire.sh./skills/customer-db/scripts/follow-up-due.sh输出为 tab 分隔的表格(含 header),字段:id / peer / user_id_external / follow_up_at / reason / context_summary / status。
./skills/customer-db/scripts/follow-up-mark-sent.sh \
--id <id> \
--sent-text "<发送的消息内容>"./skills/customer-db/scripts/follow-up-complete.sh \
--id <id> \
--sent-text "<发送的消息内容>"./db/customer.dbcs_recordbcef823
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.