SuperAPI AI Directory

wecomcli-workflow-personal-crm

Office & productivity

View repository

Updated 10-15 23:59

About this skill

WeCom Personal CRM

Use wecom-cli to operate WeCom schedules, messages, contacts, and smart sheets, automatically maintaining a personal contact relationship network.

Note: This Skill is different from wecomcli-crm(customer management). wecomcli-crm managesbusiness customers, while this Skill managesall contact relationships, including colleagues, friends, industry connections, etc.

Initial configuration (automatic initialization)

Before performing any operation, first check whether a personal CRM configuration already exists in memory. If not, automatically create it according to the following process:

Step 1: Create a smart sheet

wecom-cli doc create_doc '{"doc_type": 10, "doc_name": "个人CRM"}'

Get the docid。

Step 2: Create sub-sheets and fields

# 创建子表1: 联系人主表
wecom-cli doc smartsheet_add_sheet '{"docid": "<DOCID>", "sheet_name": "联系人"}'

# 创建子表2: 互动记录
wecom-cli doc smartsheet_add_sheet '{"docid": "<DOCID>", "sheet_name": "互动记录"}'

Get the sheet_idof each sub-sheet, then add fields:

Contact main sheet fields:

wecom-cli doc smartsheet_add_fields '{"docid": "<DOCID>", "sheet_id": "<SHEET_ID>", "fields": [
  {"field_title": "姓名", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "公司", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "职位", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "邮箱", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "手机", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "来源", "field_type": "FIELD_TYPE_SINGLE_SELECT"},
  {"field_title": "关系类型", "field_type": "FIELD_TYPE_SINGLE_SELECT"},
  {"field_title": "重要程度", "field_type": "FIELD_TYPE_SINGLE_SELECT"},
  {"field_title": "热度分", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "最后联系时间", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "最后联系内容", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "备注", "field_type": "FIELD_TYPE_TEXT"}
]}'

Interaction record fields:

wecom-cli doc smartsheet_add_fields '{"docid": "<DOCID>", "sheet_id": "<SHEET_ID>", "fields": [
  {"field_title": "关联联系人", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "互动时间", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "互动类型", "field_type": "FIELD_TYPE_SINGLE_SELECT"},
  {"field_title": "互动摘要", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "涉及主题", "field_type": "FIELD_TYPE_TEXT"}
]}'

Step 3: Save the configuration to memory

Save the following information to the memory file personal-crm-config.md:

---
name: personal-crm-config
description: 个人CRM智能表格配置信息
type: project
---

## 个人CRM表配置

- docid: <DOCID>
- url: <创建时返回的URL>
- 表格名称: 个人CRM
- 联系人 sheet_id: <SHEET_ID>
- 互动记录 sheet_id: <SHEET_ID>

Operation process

In the following commands, <DOCID> and each <SHEET_ID> are read from personal-crm-config in memory.

Mode 1: Automatic scanning to extract contacts

Automatically extract contact information from schedules and messages.

Step 1: Scan schedule participants

# 获取过去30天的日程
wecom-cli schedule get_schedule_list_by_range '{"start_time": "2026-03-03 00:00:00", "end_time": "2026-04-02 23:59:59"}'

# 获取日程详情(含参与者信息)
wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}'

Step 2: Scan message interactions

# 获取最近30天的会话列表
wecom-cli msg get_msg_chat_list '{"begin_time": "2026-03-03 00:00:00", "end_time": "2026-04-02 23:59:59"}'

# 拉取各会话的消息记录(提取互动摘要)
wecom-cli msg get_message '{"chat_type": 1, "chatid": "<CHATID>", "begin_time": "2026-03-03 00:00:00", "end_time": "2026-04-02 23:59:59"}'

Step 3: Match contacts information

wecom-cli contact get_userlist '{}'

Step 4: AI processing and writing

  • Merge and deduplicate: the same person may appear in both schedules and messages
  • Extract name, company, and position information
  • Generate interaction summaries
  • Calculate heat scores
  • Write to the contact sheet and interaction record sheet
# 写入新联系人(使用 upsert 逻辑:先查询是否存在)
wecom-cli doc smartsheet_get_records '{"docid": "<DOCID>", "sheet_id": "<联系人SHEET_ID>"}'

# 不存在则新增
wecom-cli doc smartsheet_add_records '{"docid": "<DOCID>", "sheet_id": "<联系人SHEET_ID>", "records": [{"values": {
  "姓名": [{"type": "text", "text": "张三"}],
  "公司": [{"type": "text", "text": "XX科技"}],
  "职位": [{"type": "text", "text": "产品经理"}],
  "来源": [{"text": "日程"}],
  "关系类型": [{"text": "行业人脉"}],
  "重要程度": [{"text": "中"}],
  "热度分": [{"type": "text", "text": "65"}],
  "最后联系时间": [{"type": "text", "text": "2026-04-01"}],
  "最后联系内容": [{"type": "text", "text": "讨论了Q2产品规划"}],
  "备注": [{"type": "text", "text": ""}]
}}]}'

# 写入互动记录
wecom-cli doc smartsheet_add_records '{"docid": "<DOCID>", "sheet_id": "<互动记录SHEET_ID>", "records": [{"values": {
  "关联联系人": [{"type": "text", "text": "张三"}],
  "互动时间": [{"type": "text", "text": "2026-04-01"}],
  "互动类型": [{"text": "会议"}],
  "互动摘要": [{"type": "text", "text": "Q2产品规划会,讨论了路线图和时间表"}],
  "涉及主题": [{"type": "text", "text": "产品规划, Q2目标"}]
}}]}'

Mode 2: Natural language query

Supports flexible Chinese queries.

Common query examples:

User asks AI processing method
"Who contacted me last month?" Query interaction records, filter by month, summarize and deduplicate
"What did we last talk about with the person from Company XX?" Filter contacts by company, find the most recent interaction records
"Are there any important relationships I haven't contacted in over 3 months?" Query contacts with heat score < 30 and importance = high
"How long has it been since I contacted Zhang San?" Query by name, return the last contact time and the number of days elapsed
# 查询所有联系人
wecom-cli doc smartsheet_get_records '{"docid": "<DOCID>", "sheet_id": "<联系人SHEET_ID>"}'

# 查询所有互动记录
wecom-cli doc smartsheet_get_records '{"docid": "<DOCID>", "sheet_id": "<互动记录SHEET_ID>"}'

# AI 在内存中进行过滤和计算

Mode 3: Manually add/update contacts

# 更新联系人信息
wecom-cli doc smartsheet_update_records '{"docid": "<DOCID>", "sheet_id": "<联系人SHEET_ID>", "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE", "records": [{"record_id": "RECORD_ID", "values": {
  "公司": [{"type": "text", "text": "新公司"}],
  "职位": [{"type": "text", "text": "新职位"}],
  "重要程度": [{"text": "高"}]
}}]}'

Mode 4: Overdue reminders

Check important relationships not contacted for more than N days and send reminders.

# 查询所有联系人
wecom-cli doc smartsheet_get_records '{"docid": "<DOCID>", "sheet_id": "<联系人SHEET_ID>"}'

# AI 筛选:重要程度="高" 且 最后联系时间距今 > 30/60/90 天
# 发送提醒
wecom-cli msg send_message '{"chat_type": 1, "chatid": "<USERID>", "msgtype": "text", "text": {"content": "⚠️ 联系人提醒\n\n以下重要关系已超过60天未联系:\n1. 赵六(ZZ集团)— 最后联系:95天前\n2. ..."}}'

Heat score calculation rules

Heat score = frequency score (40) + recency score (40) + importance score (20), with a maximum score of 100.

Dimension Weight Calculation method
Frequency score 40 points Number of interactions in the past 90 days, 0 times = 0 points, 20 times+ = 40 points (linear interpolation)
Recency score 40 points Days since the last interaction, within 7 days = 40 points, 90 days+ = 0 points (linear decay)
Importance score 20 points High = 20 points, Medium = 12 points, Low = 4 points

Field type write format (general rules)

For the complete field type format description, see crm-schema

Field type Write format Example
TEXT [{"type":"text","text":"值"}] Name, company, position, heat score, etc.
SINGLE_SELECT [{"text":"选项文本"}] Source, relationship type, importance level, interaction type, etc.

Practical notes

Common pitfalls

  1. Not passing key_type when updating — must include "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE"
  2. When an API call fails — check the error code: 301085 means the docid is invalid (use url instead); 2022004 means the field was not found (call add_fields first); 2022003 means the record does not exist (call add_records first). When encountering an error, first use smartsheet_get_sheet '{"url": "<URL>"}' to verify the table structure.
  3. SINGLE_SELECT option mismatch — the option text must exactly match an existing option in the table
  4. SINGLE_SELECT options do not take effect at creation time — smartsheet_add_fields The property.options passed in will not pre-create options; options are automatically created via [{"text": "选项"}] when a record is first written. When creating a field, the property parameter can be omitted.
  5. Contacts matching — contact get_userlist returns a userid, which needs to correspond to the chatid in the message
  6. Message scan scope — the conversation list returns only a limited number at a time, so it needs to be fetched in batches
  7. Deduplication logic — the same person may appear in different scenarios, and the AI needs to intelligently deduplicate and merge

Differences from wecomcli-crm

Dimension wecomcli-crm wecomcli-workflow-personal-crm
Positioning Business customer management Personal relationship network
Data source Manual entry/external import Automatic scanning of schedules + messages
Heat score None Yes (automatically calculated)
Interaction records None Yes (automatically tracked)
Overdue reminders None Yes (automatic reminders)

Data linkage

  • This Skill's data will be read by the following Skills:
    • wecomcli-workflow-morning-brief — displays attendee background in the morning briefing
    • wecomcli-workflow-business-advisor — relationship/BD advisor analyzes network dynamics