From 296b34a5014b135cc3af4a4e83895634d43a2330 Mon Sep 17 00:00:00 2001 From: liangshuo-1 <266696938+liangshuo-1@users.noreply.github.com> Date: Fri, 29 May 2026 01:09:27 +0800 Subject: [PATCH 1/2] feat(lark-contact): route user_profiles batch_query in skill - Add user_profiles batch_query row to the routing table. - Add a worked example next to the search-user one, with `lark-cli schema` first (best practice: don't guess `--data` / `--params`). - Trim description: drop the duplicated trigger clause, add personal_status / signature to the capability list so routing picks this skill up for those queries. Change-Id: Ib32c56f6a389b3c248409228f4c7461453d1dcd3 --- skills/lark-contact/SKILL.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/skills/lark-contact/SKILL.md b/skills/lark-contact/SKILL.md index 96b23bbd8..d983de6be 100644 --- a/skills/lark-contact/SKILL.md +++ b/skills/lark-contact/SKILL.md @@ -1,7 +1,7 @@ --- name: lark-contact version: 1.0.0 -description: "飞书 / Lark 通讯录,用于按姓名 / 邮箱把员工解析成 open_id,以及按 open_id 反查员工的姓名 / 部门 / 邮箱 / 联系方式。当用户说出某人姓名而下一步需要发消息 / 加群 / 排日程时,先用本 skill 把姓名换成 ID;当输出里出现 open_id 需要展示成姓名给用户看,或用户直接询问某人的部门 / 邮箱 / 联系方式时,用本 skill 查。不负责部门树遍历、按部门列员工、组织架构图,这类需求走原生 OpenAPI。" +description: "飞书 / Lark 通讯录:按姓名 / 邮箱解析成 open_id,或按 open_id 反查姓名 / 部门 / 邮箱 / 联系方式 / 个人状态 / 签名。当用户提到某人姓名要下一步发消息 / 排日程,或拿到 open_id 想查具体信息时使用。不负责部门树遍历、按部门列员工、组织架构图,这类需求走原生 OpenAPI。" metadata: requires: bins: ["lark-cli"] @@ -19,17 +19,29 @@ metadata: | 按姓名 / 邮箱搜员工拿 open_id | [`+search-user`](references/lark-contact-search-user.md) | 不支持 | | 已知 open_id 取他人资料 | `+search-user --user-ids ` | [`+get-user --user-id `](references/lark-contact-get-user.md) | | 查看自己 | `+get-user` 或 `+search-user --user-ids me` | 不支持 | +| 查同事的个人状态 / 签名 | `user_profiles batch_query` | 不支持 | 已知 open_id 只是想发消息 / 排日程,不必经过 contact —— 直接 [`lark-im`](../lark-im/SKILL.md) / [`lark-calendar`](../lark-calendar/SKILL.md)。 ## 典型场景 +找张三给他发消息:先搜,确认 open_id,再发: + ```bash -# 找张三给他发消息:先搜,确认 open_id,再发 lark-cli contact +search-user --query "张三" --has-chatted --as user lark-cli im +messages-send --user-id ou_xxx --text "Hi!" ``` +批量查同事的个人状态 / 个性签名(先用 schema 看参数)。 + +```bash +lark-cli schema contact.user_profiles.batch_query +lark-cli contact user_profiles batch_query \ + --params '{"user_id_type":"open_id"}' \ + --data '{"user_ids":["ou_xxx","ou_yyy"],"query_option":{"include_personal_status":true,"include_description":true}}' \ + --as user +``` + 搜索命中多条且后续操作有副作用(发消息、邀请会议等),把候选列给用户挑;不要擅自选第一条。 ## 注意事项 @@ -42,4 +54,4 @@ lark-cli im +messages-send --user-id ou_xxx --text "Hi!" - 发消息 / 查聊天记录 → [`lark-im`](../lark-im/SKILL.md) - 排日程 / 邀请会议 → [`lark-calendar`](../lark-calendar/SKILL.md) -- 部门树 / 按部门列员工 / 组织架构 ,通过 [`lark-openapi-explorer`](../lark-openapi-explorer/SKILL.md) 查找原生接口 +- 部门树 / 按部门列员工 / 组织架构 → [`lark-openapi-explorer`](../lark-openapi-explorer/SKILL.md) 查找原生接口 From 2d7dcc29efa03910ca2e8403052c584f5148d367 Mon Sep 17 00:00:00 2001 From: "suhui.928" Date: Thu, 28 May 2026 11:15:09 +0800 Subject: [PATCH 2/2] feat: add contact skill domain guidance --- skill-template/domains/contact.md | 33 +++++++++++++++++++++++++++++++ skills/lark-contact/SKILL.md | 4 +++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 skill-template/domains/contact.md diff --git a/skill-template/domains/contact.md b/skill-template/domains/contact.md new file mode 100644 index 000000000..2a740bf7a --- /dev/null +++ b/skill-template/domains/contact.md @@ -0,0 +1,33 @@ +## 选哪个命令 + +**user 身份和 bot 身份是两条完全独立的路径**。先确定当前身份,再按下表选命令: + +| 想做什么 | user 身份 | bot 身份 | +|---|---|---| +| 按姓名 / 邮箱搜员工拿 open_id | [`+search-user`](references/lark-contact-search-user.md) | 不支持 | +| 已知 open_id 取他人资料 | `+search-user --user-ids ` | [`+get-user --user-id `](references/lark-contact-get-user.md) | +| 查看自己 | `+get-user` 或 `+search-user --user-ids me` | 不支持 | + +已知 open_id 只是想发消息 / 排日程,不必经过 contact —— 直接 [`lark-im`](../lark-im/SKILL.md) / [`lark-calendar`](../lark-calendar/SKILL.md)。 + +## 典型场景 + +```bash +# 找张三给他发消息:先搜,确认 open_id,再发 +lark-cli contact +search-user --query "张三" --has-chatted --as user +lark-cli im +messages-send --user-id ou_xxx --text "Hi!" +``` + +搜索命中多条且后续操作有副作用(发消息、邀请会议等),把候选列给用户挑;不要擅自选第一条。 + +## 注意事项 + +- **41050 / Permission denied** 受当前身份的可见范围限制(两条命令都可能遇到)。换 bot 身份或让管理员调整可见范围,细节见 [`lark-shared`](../lark-shared/SKILL.md)。 +- **跨租户用户**(`is_cross_tenant=true`)多数业务字段为空字符串,这是飞书可见性规则,下游做空值兜底。 +- **ID 类型**:默认 `open_id`。`+get-user` 可改 `--user-id-type union_id|user_id`;`+search-user` 只接受 `open_id`。 + +## 不在本 skill 范围 + +- 发消息 / 查聊天记录 → [`lark-im`](../lark-im/SKILL.md) +- 排日程 / 邀请会议 → [`lark-calendar`](../lark-calendar/SKILL.md) +- 部门树 / 按部门列员工 / 组织架构 → [`lark-openapi-explorer`](../lark-openapi-explorer/SKILL.md) 查找原生接口 diff --git a/skills/lark-contact/SKILL.md b/skills/lark-contact/SKILL.md index d983de6be..0a1b27310 100644 --- a/skills/lark-contact/SKILL.md +++ b/skills/lark-contact/SKILL.md @@ -8,7 +8,9 @@ metadata: cliHelp: "lark-cli contact --help" --- -# lark-contact +# contact (v2) + +**CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md),其中包含认证、权限处理** ## 选哪个命令